From c7a168e22a93d65235fd382ec4dd6677e1456adb Mon Sep 17 00:00:00 2001 From: Viktor Kuzhelnyi Date: Fri, 25 Aug 2023 18:51:49 +0500 Subject: [PATCH] upd: login form (add: sample) --- src/pages/login.tsx | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/pages/login.tsx b/src/pages/login.tsx index 01ba550..e410b17 100644 --- a/src/pages/login.tsx +++ b/src/pages/login.tsx @@ -13,11 +13,24 @@ import Buttons from '../components/Buttons' import { useRouter } from 'next/router' import { getPageTitle } from '../config' +type LoginForm = { + login: string + password: string + remember: boolean +} + const LoginPage = () => { const router = useRouter() - const handleSubmit = () => { + const handleSubmit = (formValues: LoginForm) => { router.push('/dashboard') + console.log('Form values', formValues) + } + + const initialValues: LoginForm = { + login: 'john.doe', + password: 'bG1sL9eQ1uD2sK3b', + remember: true, } return ( @@ -28,10 +41,7 @@ const LoginPage = () => { - handleSubmit()} - > +