updated password form to have back button

This commit is contained in:
Abhinav-grd 2021-04-05 12:05:58 +05:30
parent 4faa7cddd6
commit ca16148fbe
4 changed files with 9 additions and 2 deletions

View file

@ -12,6 +12,7 @@ import { Spinner } from 'react-bootstrap';
interface Props { interface Props {
callback: (passphrase: any, setFieldError: any) => Promise<void>; callback: (passphrase: any, setFieldError: any) => Promise<void>;
buttonText: string; buttonText: string;
back: () => void;
} }
interface formValues { interface formValues {
passphrase: string; passphrase: string;
@ -122,6 +123,11 @@ function SetPassword(props: Props) {
</Form> </Form>
)} )}
</Formik> </Formik>
<div className="text-center" style={{ marginTop: '20px' }}>
<Button variant="link" onClick={props.back}>
{constants.GO_BACK}
</Button>
</div>
</Card.Body> </Card.Body>
</Card> </Card>
</Container> </Container>

View file

@ -73,7 +73,7 @@ export default function Generate() {
<PasswordForm <PasswordForm
callback={onSubmit} callback={onSubmit}
buttonText={constants.CHANGE_PASSWORD} buttonText={constants.CHANGE_PASSWORD}
cancel={() => router.push('/gallery')} back={() => router.push('/gallery')}
/> />
); );
} }

View file

@ -88,7 +88,7 @@ export default function Generate() {
<PasswordForm <PasswordForm
callback={onSubmit} callback={onSubmit}
buttonText={constants.SET_PASSPHRASE} buttonText={constants.SET_PASSPHRASE}
cancel={logoutUser} back={logoutUser}
/> />
</> </>
); );

View file

@ -161,6 +161,7 @@ const englishConstants = {
'failed to sync with remote server, please refresh page to try again', 'failed to sync with remote server, please refresh page to try again',
PASSWORD_GENERATION_FAILED: `your browser was unable to generate a strong enough password that meets ente's encryption standards, please try using the mobile app or another browser`, PASSWORD_GENERATION_FAILED: `your browser was unable to generate a strong enough password that meets ente's encryption standards, please try using the mobile app or another browser`,
CHANGE_PASSWORD: 'change password', CHANGE_PASSWORD: 'change password',
GO_BACK: 'go back',
}; };
export default englishConstants; export default englishConstants;