|
| 1 | +import React from 'react' |
| 2 | +import Avatar from '@material-ui/core/Avatar' |
| 3 | +import Button from '@material-ui/core/Button' |
| 4 | +import TextField from '@material-ui/core/TextField' |
| 5 | +import FormControlLabel from '@material-ui/core/FormControlLabel' |
| 6 | +import Checkbox from '@material-ui/core/Checkbox' |
| 7 | +import Link from '@material-ui/core/Link' |
| 8 | +import { Link as RouterLink } from 'react-router-dom' |
| 9 | +import Grid from '@material-ui/core/Grid' |
| 10 | +import LockOutlinedIcon from '@material-ui/icons/LockOutlined' |
| 11 | +import Typography from '@material-ui/core/Typography' |
| 12 | +import { makeStyles } from '@material-ui/core/styles' |
| 13 | + |
| 14 | +export default function Login() { |
| 15 | + const classes = useStyles() |
| 16 | + |
| 17 | + return ( |
| 18 | + <div className={classes.paper}> |
| 19 | + <Avatar className={classes.avatar}> |
| 20 | + <LockOutlinedIcon /> |
| 21 | + </Avatar> |
| 22 | + <Typography component="h1" variant="h5"> |
| 23 | + Sign in |
| 24 | + </Typography> |
| 25 | + <form className={classes.form} noValidate> |
| 26 | + <TextField |
| 27 | + variant="outlined" |
| 28 | + margin="normal" |
| 29 | + required |
| 30 | + fullWidth |
| 31 | + id="email" |
| 32 | + label="Email Address" |
| 33 | + name="email" |
| 34 | + autoComplete="email" |
| 35 | + autoFocus |
| 36 | + /> |
| 37 | + <TextField |
| 38 | + variant="outlined" |
| 39 | + margin="normal" |
| 40 | + required |
| 41 | + fullWidth |
| 42 | + name="password" |
| 43 | + label="Password" |
| 44 | + type="password" |
| 45 | + id="password" |
| 46 | + autoComplete="current-password" |
| 47 | + /> |
| 48 | + <FormControlLabel |
| 49 | + control={<Checkbox value="remember" color="primary" />} |
| 50 | + label="Remember me" |
| 51 | + /> |
| 52 | + <Button |
| 53 | + type="submit" |
| 54 | + fullWidth |
| 55 | + variant="contained" |
| 56 | + color="primary" |
| 57 | + className={classes.submit} |
| 58 | + > |
| 59 | + Sign In |
| 60 | + </Button> |
| 61 | + <Grid container> |
| 62 | + <Grid item xs> |
| 63 | + <Link component={RouterLink} to="/auth/recover" variant="body2"> |
| 64 | + Forgot password? |
| 65 | + </Link> |
| 66 | + </Grid> |
| 67 | + <Grid item> |
| 68 | + <Link component={RouterLink} to="/auth/signup" variant="body2"> |
| 69 | + {"Don't have an account? Sign Up"} |
| 70 | + </Link> |
| 71 | + </Grid> |
| 72 | + </Grid> |
| 73 | + </form> |
| 74 | + </div> |
| 75 | + ) |
| 76 | +} |
| 77 | + |
| 78 | +const useStyles = makeStyles(theme => ({ |
| 79 | + paper: { |
| 80 | + marginTop: theme.spacing(8), |
| 81 | + display: 'flex', |
| 82 | + flexDirection: 'column', |
| 83 | + alignItems: 'center', |
| 84 | + }, |
| 85 | + avatar: { |
| 86 | + margin: theme.spacing(1), |
| 87 | + backgroundColor: theme.palette.secondary.main, |
| 88 | + }, |
| 89 | + form: { |
| 90 | + width: '100%', // Fix IE 11 issue. |
| 91 | + marginTop: theme.spacing(1), |
| 92 | + }, |
| 93 | + submit: { |
| 94 | + margin: theme.spacing(3, 0, 2), |
| 95 | + }, |
| 96 | +})) |
0 commit comments