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/Login.js | |
parent | fc96a9a206a825171da87a7f23cc2ea16b1d645d (diff) |
`useVisitor` hook
Diffstat (limited to 'vnext/src/ui/Login.js')
-rw-r--r-- | vnext/src/ui/Login.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/vnext/src/ui/Login.js b/vnext/src/ui/Login.js index 5a96c822..98f9328b 100644 --- a/vnext/src/ui/Login.js +++ b/vnext/src/ui/Login.js @@ -8,22 +8,22 @@ import { useForm } from 'react-hook-form'; import { me, facebookLink, vkLink, appleLink } from '../api'; import './Login.css'; +import { useVisitor } from './VisitorContext'; /** - * @typedef {Object} LoginProps - * @property {import('../api').SecureUser} visitor - * @property {function} onAuth + * @typedef {object} LoginProps + * @property {Function} onAuth */ /** * Login page + * * @param {LoginProps} props */ -function Login({ visitor, onAuth }) { - +function Login({ onAuth }) { const location = useLocation(); const navigate = useNavigate(); - + const [visitor] = useVisitor(); useEffect(() => { if (visitor.hash) { const {retpath } = location.state || '/'; |