diff options
author | Vitaly Takmazov | 2022-10-31 22:48:30 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-13 10:37:58 +0300 |
commit | 8887e1b51565b992f34c955c459125eb85b28483 (patch) | |
tree | 7fc8130f523014864e2d60aa9628e7a7ee7e7dd5 /vnext/src/ui/Header.js | |
parent | fc96a9a206a825171da87a7f23cc2ea16b1d645d (diff) |
`useVisitor` hook
Diffstat (limited to 'vnext/src/ui/Header.js')
-rw-r--r-- | vnext/src/ui/Header.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/vnext/src/ui/Header.js b/vnext/src/ui/Header.js index 3162c9ea..db8959ea 100644 --- a/vnext/src/ui/Header.js +++ b/vnext/src/ui/Header.js @@ -4,8 +4,10 @@ import { Link, useNavigate } from 'react-router-dom'; import Icon from './Icon'; import { UserLink } from './UserInfo'; import SearchBox from './SearchBox'; +import { useVisitor } from './VisitorContext'; -function Header({ visitor, className }) { +function Header() { + const [visitor] = useVisitor(); const navigate = useNavigate(); /** * @param {string} searchString @@ -17,7 +19,7 @@ function Header({ visitor, className }) { navigate(location); }, [navigate]); return ( - <div id="header" className={className}> + <div id="header"> <div id="header_wrapper"> { visitor.uid < 0 ? |