From 8887e1b51565b992f34c955c459125eb85b28483 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 31 Oct 2022 22:48:30 +0300 Subject: `useVisitor` hook --- vnext/src/ui/Login.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'vnext/src/ui/Login.js') 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 || '/'; -- cgit v1.2.3