Skip to content

Commit

Permalink
atualizacao
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasvduarte committed Nov 16, 2019
1 parent 9ab6f7d commit 1abc3ef
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
10 changes: 6 additions & 4 deletions src/screen/login/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,15 @@ function Login() {
event.preventDefault()
}

const postLoginUser = async () => {
const postLoginUser = async (event) => {
event.preventDefault();
setRequest(true)
setError(false)
await LoginApi.postLoginApi(values).then(res => {
login(res.data.token)
id(res.data._id)
setRequest(false)
history.push("/pessoas")
setTimeout(() => history.replace("/pessoas"), 10)
}).catch(error => {
setError(true)
setRequest(false)
Expand All @@ -147,7 +148,7 @@ function Login() {
<div className={classes.root}>
<img src={logo} className={classes.logo} alt="logo" />

<form>
<form onSubmit={postLoginUser}>
<ThemeProvider theme={theme}>
{error && <InvalidLogin />}
<Field className={classes.margin} onChange={handleChange('email')} name="email" component={renderTextField} label="Name ou Email" />
Expand All @@ -160,11 +161,12 @@ function Login() {
/>
</ThemeProvider>
<div></div>
<Button variant="contained" size="large" color="secondary" className={classes.marginButton} disabled={!buttonSubmitValidate} onClick={postLoginUser}> Login </Button>
<Button type='submit' variant="contained" size="large" color="secondary" className={classes.marginButton} disabled={!buttonSubmitValidate} > Login </Button>
</form>
</div>
);
}

export default reduxForm({
form: 'MaterialUiFormLogin', // a unique identifier for this form
validate
Expand Down
13 changes: 8 additions & 5 deletions src/screen/missions/myMission/CreateMission.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,15 @@ function CreateMissionForm() {
<Field onChange={handleChange('start_time')} name="start_time" component={DataPicker} label={"Data de Início"} selectedDate={values.start_time} />
<Field onChange={handleChange('end_time')} name="end_time" component={DataPicker} label={"Data de Fim"} minData={values.start_time} selectedDate={values.end_time} />

<Field onChange={handleChange('has_image')} name="has_image" component={RadioButtonTypeSent} checked={values.has_image} label="Imagem" />
<Field onChange={handleChange('has_video')} name="has_video" component={RadioButtonTypeSent} checked={values.has_video} label="Vídeo" />
<Field onChange={handleChange('has_text')} name="has_text" component={RadioButtonTypeSent} checked={values.has_text} label="Texto" />
<Field onChange={handleChange('has_audio')} name="has_audio" component={RadioButtonTypeSent} checked={values.has_audio} label="Áudio" />
<Field onChange={handleChange('has_geolocation')} name="has_geolocation" component={RadioButtonTypeSent} checked={values.has_geolocation} label="Geolocalização" />

<Field onChange={handleChange('has_image')} name="has_image" component={RadioButtonTypeSent} checked={values.has_image} label="Imagem" />
{
/*
<Field onChange={handleChange('has_video')} name="has_video" component={RadioButtonTypeSent} checked={values.has_video} label="Vídeo" />
<Field onChange={handleChange('has_audio')} name="has_audio" component={RadioButtonTypeSent} checked={values.has_audio} label="Áudio" />
<Field onChange={handleChange('has_geolocation')} name="has_geolocation" component={RadioButtonTypeSent} checked={values.has_geolocation} label="Geolocalização" />
*/
}
<div id='marginForm'>
<Button size="large" onClick={handleClickAdvancedOptions}>Opções Avançadas</Button>
</div>
Expand Down

0 comments on commit 1abc3ef

Please sign in to comment.