[IMPROVE] Added a Reset Button in the Account Profile Page (#24078)

Co-authored-by: Murtaza Patrawala <34130764+murtaza98@users.noreply.github.com>
pull/24117/head^2
P Aswini Kumar 4 years ago committed by GitHub
parent dce71d2aa7
commit eb7e37d6cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      client/views/account/AccountProfilePage.js

@ -37,7 +37,7 @@ const AccountProfilePage = () => {
const user = useUser();
const { values, handlers, hasUnsavedChanges, commit } = useForm(getInitialValues(user ?? {}));
const { values, handlers, hasUnsavedChanges, commit, reset } = useForm(getInitialValues(user ?? {}));
const [canSave, setCanSave] = useState(true);
const setModal = useSetModal();
const logout = useLogout();
@ -221,6 +221,9 @@ const AccountProfilePage = () => {
<Page>
<Page.Header title={t('Profile')}>
<ButtonGroup>
<Button primary danger disabled={!hasUnsavedChanges} onClick={reset}>
{t('Reset')}
</Button>
<Button primary disabled={!hasUnsavedChanges || !canSave || loggingOut} onClick={onSave}>
{t('Save_changes')}
</Button>

Loading…
Cancel
Save