Merge pull request #61 from ente-io/remove_back_button_password_reset
remove back button from password set page
This commit is contained in:
commit
f23f827146
|
@ -114,11 +114,16 @@ function SetPassword(props: Props) {
|
|||
</Form>
|
||||
)}
|
||||
</Formik>
|
||||
<div className="text-center" style={{ marginTop: '20px' }}>
|
||||
<Button variant="link" onClick={props.back}>
|
||||
{constants.GO_BACK}
|
||||
</Button>
|
||||
</div>
|
||||
{props.back && (
|
||||
<div
|
||||
className="text-center"
|
||||
style={{ marginTop: '20px' }}
|
||||
>
|
||||
<Button variant="link" onClick={props.back}>
|
||||
{constants.GO_BACK}
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
</Card.Body>
|
||||
</Card>
|
||||
</Container>
|
||||
|
|
|
@ -3,7 +3,7 @@ import React, { useEffect, useState } from 'react';
|
|||
import { slide as Menu } from 'react-burger-menu';
|
||||
import billingService, { Subscription } from 'services/billingService';
|
||||
import constants from 'utils/strings/constants';
|
||||
import { getData, LS_KEYS } from 'utils/storage/localStorage';
|
||||
import { getData, LS_KEYS, setData } from 'utils/storage/localStorage';
|
||||
import { getToken } from 'utils/common/key';
|
||||
import { getEndpoint } from 'utils/common/apiUtil';
|
||||
import { Button } from 'react-bootstrap';
|
||||
|
@ -214,7 +214,10 @@ export default function Sidebar(props: Props) {
|
|||
</>
|
||||
<LinkButton
|
||||
style={{ marginTop: '30px' }}
|
||||
onClick={() => router.push('changePassword')}
|
||||
onClick={() => {
|
||||
setData(LS_KEYS.SHOW_BACK_BUTTON, { value: true });
|
||||
router.push('changePassword');
|
||||
}}
|
||||
>
|
||||
{constants.CHANGE_PASSWORD}
|
||||
</LinkButton>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React, { useState, useEffect, useContext } from 'react';
|
||||
import constants from 'utils/strings/constants';
|
||||
import { getData, LS_KEYS } from 'utils/storage/localStorage';
|
||||
import { getData, LS_KEYS, setData } from 'utils/storage/localStorage';
|
||||
import { useRouter } from 'next/router';
|
||||
import { getKey, SESSION_KEYS, setKey } from 'utils/storage/sessionStorage';
|
||||
import { B64EncryptionResult } from 'services/uploadService';
|
||||
|
@ -66,14 +66,21 @@ export default function Generate() {
|
|||
);
|
||||
|
||||
setSessionKeys(key);
|
||||
redirectToGallery();
|
||||
};
|
||||
const redirectToGallery = () => {
|
||||
setData(LS_KEYS.SHOW_BACK_BUTTON, { value: false });
|
||||
router.push('/gallery');
|
||||
};
|
||||
|
||||
return (
|
||||
<PasswordForm
|
||||
callback={onSubmit}
|
||||
buttonText={constants.CHANGE_PASSWORD}
|
||||
back={() => router.push('/gallery')}
|
||||
back={
|
||||
getData(LS_KEYS.SHOW_BACK_BUTTON)?.value
|
||||
? redirectToGallery
|
||||
: null
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ export enum LS_KEYS {
|
|||
PLANS = 'plans',
|
||||
IS_FIRST_LOGIN = 'isFirstLogin',
|
||||
JUST_SIGNED_UP = 'justSignedUp',
|
||||
SHOW_BACK_BUTTON = 'showBackButton',
|
||||
}
|
||||
|
||||
export const setData = (key: LS_KEYS, value: object) => {
|
||||
|
|
Loading…
Reference in a new issue