-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
186 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
import * as React from 'react'; | ||
import Avatar from '@mui/material/Avatar'; | ||
import Button from '@mui/material/Button'; | ||
import TextField from '@mui/material/TextField'; | ||
import FormControlLabel from '@mui/material/FormControlLabel'; | ||
import Checkbox from '@mui/material/Checkbox'; | ||
import Link from '@mui/material/Link'; | ||
import Grid from '@mui/material/Grid'; | ||
import Box from '@mui/material/Box'; | ||
import CatchingPokemonIcon from '@mui/icons-material/CatchingPokemon'; | ||
|
||
import Typography from '@mui/material/Typography'; | ||
import Container from '@mui/material/Container'; | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
function Copyright(props) { | ||
return ( | ||
<Typography variant="body2" color="text.secondary" align="center" {...props}> | ||
{'Copyright © '} | ||
<Link color="inherit" href="https://mui.com/"> | ||
Pokédata | ||
</Link>{' '} | ||
{new Date().getFullYear()} | ||
{'.'} | ||
</Typography> | ||
); | ||
} | ||
|
||
|
||
export default function SignIn({state, dispatch}) { | ||
const navigateTo = useNavigate(); | ||
const handleSubmit = (event) => { | ||
event.preventDefault(); | ||
const data = new FormData(event.currentTarget); | ||
// eslint-disable-next-line no-console | ||
const user = { | ||
email: data.get('email'), | ||
password: data.get('password'), | ||
} | ||
/* dispatch({type: 'signIn', value: user}) */ | ||
navigateTo('/') | ||
|
||
}; | ||
|
||
return ( | ||
<Container component="main" maxWidth="xs"> | ||
|
||
<Box | ||
sx={{ | ||
marginTop: 8, | ||
display: 'flex', | ||
flexDirection: 'column', | ||
alignItems: 'center', | ||
}} | ||
> | ||
<Avatar sx={{ m: 1, bgcolor: 'primary.main' }}> | ||
<CatchingPokemonIcon /> | ||
</Avatar> | ||
<Typography component="h1" variant="h5"> | ||
Sign in | ||
</Typography> | ||
<Box component="form" onSubmit={handleSubmit} noValidate sx={{ mt: 1 }}> | ||
<TextField | ||
margin="normal" | ||
required | ||
fullWidth | ||
id="email" | ||
label="e-mail" | ||
name="email" | ||
autoFocus | ||
/> | ||
<TextField | ||
margin="normal" | ||
required | ||
fullWidth | ||
name="password" | ||
label="Password" | ||
id="password" | ||
/> | ||
<FormControlLabel | ||
control={<Checkbox value="remember" color="primary" />} | ||
label="Remember me" | ||
/> | ||
<Button | ||
type="submit" | ||
fullWidth | ||
variant="contained" | ||
sx={{ mt: 3, mb: 2 }} | ||
> | ||
Sign In | ||
</Button> | ||
<Grid container> | ||
<Grid item xs> | ||
<Link href="#" variant="body2"> | ||
Forgot password? | ||
</Link> | ||
</Grid> | ||
<Grid item> | ||
<Link href="#" variant="body2"> | ||
{"Don't have an account? Sign Up"} | ||
</Link> | ||
</Grid> | ||
</Grid> | ||
</Box> | ||
</Box> | ||
<Copyright sx={{ mt: 8, mb: 4 }} /> | ||
</Container> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters