remove logout from profile card+
Hadrien Froger hadrien@octree.ch
Fri, 14 Aug 2020 09:21:33 +0100
3 files changed,
24 insertions(+),
36 deletions(-)
M
app/src/containers/Profile/EditPassword.js
→
app/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.js
→
app/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.json
→
app/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"