diff --git a/public/assets/images/empresa/logoAlphaBC.svg b/public/assets/images/empresa/logoAlphaBC.svg new file mode 100644 index 0000000..229bb48 --- /dev/null +++ b/public/assets/images/empresa/logoAlphaBC.svg @@ -0,0 +1,74 @@ + + + + +Created by potrace 1.16, written by Peter Selinger 2001-2019 + + + + + + + + + + + + + + + + + + + + diff --git a/src/app/main/sign-in/SignInPage.tsx b/src/app/main/sign-in/SignInPage.tsx index cc480c1..72ef2ed 100644 --- a/src/app/main/sign-in/SignInPage.tsx +++ b/src/app/main/sign-in/SignInPage.tsx @@ -1,20 +1,36 @@ +import { Controller, useForm } from 'react-hook-form'; +import Button from '@mui/material/Button'; +import Checkbox from '@mui/material/Checkbox'; +import FormControl from '@mui/material/FormControl'; +import FormControlLabel from '@mui/material/FormControlLabel'; +import TextField from '@mui/material/TextField'; import Typography from '@mui/material/Typography'; import { Link } from 'react-router-dom'; +import _ from '@lodash'; +import Paper from '@mui/material/Paper'; +import FuseSvgIcon from '@fuse/core/FuseSvgIcon'; import AvatarGroup from '@mui/material/AvatarGroup'; import Avatar from '@mui/material/Avatar'; import Box from '@mui/material/Box'; -import Paper from '@mui/material/Paper'; -import { useState } from 'react'; +import { z } from 'zod'; +import { zodResolver } from '@hookform/resolvers/zod'; import Tabs from '@mui/material/Tabs'; import Tab from '@mui/material/Tab'; -import CardContent from '@mui/material/CardContent'; -import _ from '@lodash'; -import Alert from '@mui/material/Alert'; -import Button from '@mui/material/Button'; -import FuseSvgIcon from '@fuse/core/FuseSvgIcon'; +import { useState } from 'react'; import JwtLoginTab from './tabs/JwtSignInTab'; import FirebaseSignInTab from './tabs/FirebaseSignInTab'; +/** + * Form Validation Schema + */ +const schema = z.object({ + email: z.string().email('You must enter a valid email').nonempty('You must enter an email'), + password: z + .string() + .min(8, 'Password is too short - must be at least 8 chars.') + .nonempty('Please enter your password.') +}); + const tabs = [ { id: 'jwt', @@ -30,49 +46,65 @@ const tabs = [ } ]; +type FormType = { + email: string; + password: string; + remember?: boolean; +}; + +const defaultValues = { + email: '', + password: '', + remember: true +}; + /** - * The sign in page. + * The full screen reversed sign in page. */ function SignInPage() { const [selectedTabId, setSelectedTabId] = useState(tabs[0].id); function handleSelectTab(id: string) { setSelectedTabId(id); + } + + const { control, formState, handleSubmit, reset } = useForm({ + mode: 'onChange', + defaultValues, + resolver: zodResolver(schema) + }); + + const { isValid, dirtyFields, errors } = formState; + + function onSubmit() { + reset(defaultValues); } return ( -
- - - logo +
+ +
+
+ logo - - Sign in - -
- Don't have an account? - - Sign up - -
+ + Iniciar Sesión + +
+ Aún no tienes cuenta? + + Regístrate + +
- - You are browsing Fuse React Demo. Click on the "Sign in" button to access the Demo and - Documentation. - - - ))} - {selectedTabId === 'jwt' && } + {selectedTabId === 'firebase' && } -
-
- - Or continue with - -
-
+
+
+ + Or continue with + +
+
-
- - - -
- - - - - - - - - - - - - - - - - - - -
-
-
Welcome to
-
our community
-
-
- Fuse helps developers to build organized and well coded dashboards full of beautiful and rich - modules. Join us and start building your application today. -
-
- - - - - - - -
- More than 17k people joined us, it's your turn -
+
+ + + +
-
+ + +
+ logo +
+
Welcome to
+
our community
+
+
+ Fuse helps developers to build organized and well coded dashboards full of beautiful and + rich modules. Join us and start building your application today. +
+
+ + + + + + + +
+ More than 17k people joined us, it's your turn +
+
+
+
+
); } -export default SignInPage; +export default SignInPage; \ No newline at end of file