Browse Source
✨ added login page See merge request fia72-dev/eva_lernsituation!18f/raum-übersicht^2
2 changed files with 71 additions and 28 deletions
@ -1,36 +1,80 @@ |
|||||||
import React, { Component } from "react"; |
import React, { Component } from "react"; |
||||||
import TextField from "@material-ui/core/TextField"; |
import { TextField, Typography, Grid, Fab, Container } from "@material-ui/core"; |
||||||
|
import SendIcon from "@material-ui/icons/Send"; |
||||||
|
import { withStyles, createStyles } from "@material-ui/styles"; |
||||||
|
|
||||||
|
const useStyles = createStyles(theme => ({ |
||||||
|
textField: { |
||||||
|
margingLeft: theme.spacing(1), |
||||||
|
marginRight: theme.spacing(1) |
||||||
|
}, |
||||||
|
fab: { |
||||||
|
margin: theme.spacing(1) |
||||||
|
}, |
||||||
|
form: { |
||||||
|
backgroundColor: "#f5f5f5", |
||||||
|
borderRadius: "5px", |
||||||
|
margin: "20px", |
||||||
|
padding: "20px", |
||||||
|
boxShadow: "0px 0px 5px 0px lightgrey", |
||||||
|
border: "1px solid lightgrey" |
||||||
|
} |
||||||
|
})); |
||||||
|
|
||||||
class Login extends Component { |
class Login extends Component { |
||||||
state = {}; |
state = { username: "", password: "" }; |
||||||
|
|
||||||
|
handleChange = name => event => { |
||||||
|
this.setState({ [name]: event.target.value }); |
||||||
|
}; |
||||||
|
|
||||||
render() { |
render() { |
||||||
|
const classes = this.props.classes; |
||||||
|
|
||||||
return ( |
return ( |
||||||
<form> |
<Container maxWidth="md"> |
||||||
<TextField |
<div className={classes.form}> |
||||||
variant="outlined" |
<Grid container direction="row" justify="center" alignItems="center"> |
||||||
margin="normal" |
<Grid container spacing={1}> |
||||||
required |
<Grid item xs={12}> |
||||||
fullWidth |
<Typography align="center" variant="h4"> |
||||||
id="email" |
Login |
||||||
label="Email Address" |
</Typography> |
||||||
name="email" |
</Grid> |
||||||
autoComplete="email" |
<Grid item xs={12}> |
||||||
autoFocus |
<TextField |
||||||
/> |
fullWidth={true} |
||||||
<TextField |
id="outlined-name" |
||||||
type="password" |
label="Username" |
||||||
variant="outlined" |
className={classes.textField} |
||||||
margin="normal" |
value={this.state.username} |
||||||
required |
onChange={this.handleChange("username")} |
||||||
fullWidth |
margin="normal" |
||||||
id="password" |
variant="outlined" |
||||||
label="Password" |
/> |
||||||
name="password" |
</Grid> |
||||||
autoComplete="password" |
<Grid item xs={12}> |
||||||
/> |
<TextField |
||||||
</form> |
fullWidth={true} |
||||||
|
id="outlined-name" |
||||||
|
label="Password" |
||||||
|
className={classes.textField} |
||||||
|
value={this.state.password} |
||||||
|
onChange={this.handleChange("password")} |
||||||
|
margin="normal" |
||||||
|
variant="outlined" |
||||||
|
type="password" |
||||||
|
/> |
||||||
|
</Grid> |
||||||
|
</Grid> |
||||||
|
<Fab color="primary" aria-label="Send" className={classes.fab}> |
||||||
|
<SendIcon /> |
||||||
|
</Fab> |
||||||
|
</Grid> |
||||||
|
</div> |
||||||
|
</Container> |
||||||
); |
); |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
export default Login; |
export default withStyles(useStyles)(Login); |
||||||
|
|||||||
Loading…
Reference in new issue