all repos — caroster @ 635ded3062fbfd2e227ac41fb76a4f889071d5ac

[Octree] Group carpool to your event https://caroster.io

remove logout from profile card+
Hadrien Froger hadrien@octree.ch
Fri, 14 Aug 2020 09:21:33 +0100
commit

635ded3062fbfd2e227ac41fb76a4f889071d5ac

parent

5ccc33f5f752bb72bd723506344fe7dbe49ffa8a

M app/src/containers/Profile/EditPassword.jsapp/src/containers/Profile/EditPassword.js

@@ -29,20 +29,6 @@ save();

}} > <Card> - <CardHeader - title={t('profile.actions.change_password')} - action={ - <IconButton - color="inherit" - id="ChangePasswordAction" - type="submit" - title={t('profile.actions.save')} - disabled={oldPassword.length < 4 || newPassword.length < 4} - > - <Icon>done</Icon> - </IconButton> - } - /> <CardContent> <TextField label={t('profile.current_password')}
M app/src/containers/Profile/index.jsapp/src/containers/Profile/index.js

@@ -78,22 +78,6 @@ setIsEditing(!isEditing);

}} > <Card> - <CardHeader - action={ - <IconButton - color="inherit" - id="EditProfileAction" - type="submit" - title={ - isEditing - ? t('profile.actions.save') - : t('profile.actions.edit') - } - > - <Icon>{isEditing ? 'done' : 'edit'}</Icon> - </IconButton> - } - /> <CardContent> <ProfileField name="firstName"

@@ -125,12 +109,10 @@ })}

onChange={setEmail} isEditing={isEditing} /> - </CardContent> - <CardActions className={classes.actions}> {isEditing && ( <Button type="button" - color="primary" + className={classes.changePassword} onClick={evt => { if (evt.preventDefault) evt.preventDefault(); setIsEditingPassword(true);

@@ -139,9 +121,26 @@ >

{t('profile.actions.change_password')} </Button> )} + </CardContent> + <CardActions className={classes.actions}> {!isEditing && ( - <Button type="button" color="default" onClick={() => logout()}> - {t('profile.actions.logout')} + <Button + type="button" + color="primary" + onClick={() => setIsEditing(true)} + variant="contained" + > + {t('profile.actions.edit')} + </Button> + )} + {isEditing && ( + <Button + type="submit" + color="primary" + onClick={() => setIsEditing(false)} + variant="contained" + > + {t('profile.actions.save')} </Button> )} </CardActions>

@@ -152,6 +151,9 @@ };

const useStyles = makeStyles(theme => ({ actions: { + marginTop: theme.spacing(2), + }, + changePassword: { marginTop: theme.spacing(2), }, }));
M app/src/locales/fr.jsonapp/src/locales/fr.json

@@ -132,7 +132,7 @@ "updated": "Profil mis à jour",

"actions": { "save": "Enregistrer", "edit": "Editer", - "change_password": "Mot de passe oublié ?", + "change_password": "Changer son mot de passe", "logout": "Se déconnecter", "cancel": "Annuler", "save_new_password": "Mettre à jour"