From 3eadacb00abafba4d09420e2b143d11a4354ace5 Mon Sep 17 00:00:00 2001 From: Abhinav Date: Sat, 25 Jun 2022 20:14:21 +0530 Subject: [PATCH] remove the use of dialogbox from recovery key modal --- src/components/RecoveryKey/index.tsx | 60 +++++++++++++++------------- 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/src/components/RecoveryKey/index.tsx b/src/components/RecoveryKey/index.tsx index 3180edf40..ca01dd149 100644 --- a/src/components/RecoveryKey/index.tsx +++ b/src/components/RecoveryKey/index.tsx @@ -2,13 +2,18 @@ import React, { useContext, useEffect, useState } from 'react'; import { downloadAsFile } from 'utils/file'; import { getRecoveryKey } from 'utils/crypto'; import constants from 'utils/strings/constants'; -import DialogBox from '../DialogBox'; import CodeBlock from '../CodeBlock'; -import { ButtonProps, Typography } from '@mui/material'; +import { + Button, + Dialog, + DialogActions, + DialogContent, + Typography, +} from '@mui/material'; import * as bip39 from 'bip39'; import { DashedBorderWrapper } from './styledComponents'; -import { DialogBoxAttributes } from 'types/dialogBox'; import { AppContext } from 'pages/_app'; +import DialogTitleWithCloseButton from 'components/DialogBox/titleWithCloseButton'; // mobile client library only supports english. bip39.setDefaultWordlist('english'); @@ -46,36 +51,35 @@ function RecoveryKey({ somethingWentWrong, ...props }: Props) { props.onHide(); } - const recoveryKeyDialogAttributes: DialogBoxAttributes = { - title: constants.RECOVERY_KEY, - close: { - text: constants.SAVE_LATER, - variant: 'secondary' as ButtonProps['color'], - }, - proceed: { - text: constants.SAVE, - action: onSaveClick, - disabled: !recoveryKey, - variant: 'accent' as ButtonProps['color'], - }, - }; - return ( - - {constants.RECOVERY_KEY_DESCRIPTION} - - - - {constants.KEY_NOT_STORED_DISCLAIMER} + maxWidth="xs"> + + {constants.RECOVERY_KEY} + + + + {constants.RECOVERY_KEY_DESCRIPTION} - - + + + + {constants.KEY_NOT_STORED_DISCLAIMER} + + + + + + + + ); } export default RecoveryKey;