|
|
@ -22,15 +22,14 @@ import InputLabel from '@material-ui/core/InputLabel'; |
|
|
|
import MenuItem from '@material-ui/core/MenuItem'; |
|
|
|
import FormControl from '@material-ui/core/FormControl'; |
|
|
|
import Select from '@material-ui/core/Select'; |
|
|
|
import OutlinedInput from '@material-ui/core/OutlinedInput'; |
|
|
|
var sha512 = require('hash.js/lib/hash/sha/512'); |
|
|
|
|
|
|
|
const hash = 'edda65dbb3658c0dfe65b8a419dbee5c19c5d81cd92b31fc499ddaeff293cee83f74e3882f33713b7c3748349f51bb84da33f1896827b1a576ad65ebcb48d341' |
|
|
|
|
|
|
|
const Transition = React.forwardRef(function Transition(props, ref) { |
|
|
|
return <Slide direction="up" ref={ref} {...props} />; |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const styles = theme => ({ |
|
|
|
container: { |
|
|
|
display: 'flex', |
|
|
@ -153,6 +152,8 @@ class Create extends React.Component { |
|
|
|
technicalOpen: false, |
|
|
|
dialogUploaded: false, |
|
|
|
image: false, |
|
|
|
login: true, |
|
|
|
password: "", |
|
|
|
} |
|
|
|
|
|
|
|
setStates = () => { |
|
|
@ -218,6 +219,10 @@ class Create extends React.Component { |
|
|
|
this.setState({[key]: true}) |
|
|
|
} |
|
|
|
|
|
|
|
handleLoginClose = () => { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
handleDialogOpen = (error) => { |
|
|
|
this.setState({ dialogOpen: true, dialogMessage: error }); |
|
|
|
}; |
|
|
@ -688,6 +693,33 @@ class Create extends React.Component { |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
handlePassword = event => { |
|
|
|
this.setState({password: event.target.value}) |
|
|
|
} |
|
|
|
|
|
|
|
createLoginDialog(){ |
|
|
|
return ( |
|
|
|
<Dialog open={this.state.login} aria-labelledby="form-dialog-title"> |
|
|
|
<DialogTitle id="form-dialog-title">Login</DialogTitle> |
|
|
|
<DialogContent> |
|
|
|
<DialogContentText> |
|
|
|
Melde dich an um Scooter anlegen zu können |
|
|
|
</DialogContentText> |
|
|
|
<TextField |
|
|
|
value={this.state.password} |
|
|
|
autoFocus |
|
|
|
margin="dense" |
|
|
|
id="name" |
|
|
|
label="Passwort" |
|
|
|
type="password" |
|
|
|
fullWidth |
|
|
|
onChange={this.handlePassword} |
|
|
|
/> |
|
|
|
</DialogContent> |
|
|
|
</Dialog> |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
render(){ |
|
|
|
const { classes } = this.props; |
|
|
|
return( |
|
|
@ -711,6 +743,7 @@ class Create extends React.Component { |
|
|
|
{this.createChipDialog('vorteile')} |
|
|
|
{this.createChipDialog('nachteile')} |
|
|
|
{this.createDoneDialog()} |
|
|
|
{sha512().update(this.state.password).digest('hex')!==hash ? this.createLoginDialog(): undefined} |
|
|
|
</div> |
|
|
|
) |
|
|
|
} |
|
|
|