Improve login screen

This commit is contained in:
Pierre HUBERT 2021-05-11 18:28:54 +02:00
parent b2a1369038
commit 0d581cca41
2 changed files with 116 additions and 106 deletions

14
.vscode/settings.json vendored
View File

@ -1,5 +1,17 @@
{ {
"files.exclude": { "files.exclude": {
"node_modules": true "node_modules": true
} },
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"prettier.tabWidth": 4,
"prettier.useTabs": true,
"editor.formatOnSave": true
} }

View File

@ -4,57 +4,78 @@
* @author Pierre Hubert * @author Pierre Hubert
*/ */
import { Typography, Link, makeStyles, Container, CssBaseline, Avatar, TextField, FormControlLabel, Checkbox, Button, Grid, Box } from "@material-ui/core"; import {
import LockOutlinedIcon from '@material-ui/icons/LockOutlined'; Typography,
Link,
makeStyles,
Container,
CssBaseline,
Avatar,
TextField,
FormControlLabel,
Checkbox,
Button,
Grid,
Box,
} from "@material-ui/core";
import LockOutlinedIcon from "@material-ui/icons/LockOutlined";
import React from "react"; import React from "react";
function Copyright() { function Copyright() {
return ( return (
<Typography variant="body2" color="textSecondary" align="center"> <Typography variant="body2" color="textSecondary" align="center">
{'Copyright © '} {"Copyright © "}
<Link color="inherit" href="https://material-ui.com/"> Comunic&nbsp;
Your Website
</Link>{' '}
{new Date().getFullYear()} {new Date().getFullYear()}
{'.'} {"."}
</Typography> </Typography>
); );
} }
const useStyles = makeStyles((theme) => ({
paper: {
marginTop: theme.spacing(8),
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
},
avatar: {
margin: theme.spacing(1),
backgroundColor: theme.palette.secondary.main,
},
form: {
width: '100%', // Fix IE 11 issue.
marginTop: theme.spacing(1),
},
submit: {
margin: theme.spacing(3, 0, 2),
},
}));
export function LoginRoute() {
const classes = useStyles();
export class LoginRoute extends React.Component {
render() {
return ( return (
<div
style={{
display: "flex",
justifyContent: "center",
alignItems: "center",
height: "100%",
}}
>
<Container component="main" maxWidth="xs"> <Container component="main" maxWidth="xs">
<CssBaseline /> <CssBaseline />
<div className={classes.paper}> <div
<Avatar className={classes.avatar}> style={{
marginTop: "8px",
display: "flex",
flexDirection: "column",
alignItems: "center",
}}
>
<Avatar
style={{
margin: "1px",
backgroundColor: "pink",
}}
>
<LockOutlinedIcon /> <LockOutlinedIcon />
</Avatar> </Avatar>
<Typography component="h1" variant="h5"> <Typography
Sign in component="h1"
variant="h5"
style={{ margin: "10px" }}
>
Comunic Console
</Typography> </Typography>
<form className={classes.form} noValidate> <form
style={{
width: "100%", // Fix IE 11 issue.
marginTop: "1px",
}}
noValidate
>
<TextField <TextField
variant="outlined" variant="outlined"
margin="normal" margin="normal"
@ -66,48 +87,25 @@ export function LoginRoute() {
autoComplete="email" autoComplete="email"
autoFocus autoFocus
/> />
<TextField
variant="outlined"
margin="normal"
required
fullWidth
name="password"
label="Password"
type="password"
id="password"
autoComplete="current-password"
/>
<FormControlLabel
control={<Checkbox value="remember" color="primary" />}
label="Remember me"
/>
<Button <Button
type="submit" type="submit"
fullWidth fullWidth
variant="contained" variant="contained"
color="primary" color="primary"
className={classes.submit} style={{
margin: "10px 0px 2px 0px",
}}
> >
Sign In Sign In
</Button> </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>
</form> </form>
</div> </div>
<Box mt={8}> <Box mt={8}>
<Copyright /> <Copyright />
</Box> </Box>
</Container> </Container>
</div>
); );
} }
}