pass button title and modal title as prop
This commit is contained in:
@@ -33,7 +33,9 @@ export const AccountsModal = () => {
|
||||
if (accountToSwitchTo)
|
||||
return (
|
||||
<ConfirmPasswordModal
|
||||
modalTitle="Switch account"
|
||||
accountName={accountToSwitchTo}
|
||||
buttonTitle="Switch account"
|
||||
onClose={() => {
|
||||
handleClose();
|
||||
setDialogToDisplay('Accounts');
|
||||
|
||||
@@ -6,10 +6,14 @@ import { AccountsContext } from 'src/context';
|
||||
|
||||
export const ConfirmPasswordModal = ({
|
||||
accountName,
|
||||
modalTitle,
|
||||
onClose,
|
||||
onConfirm,
|
||||
buttonTitle,
|
||||
}: {
|
||||
accountName?: string;
|
||||
modalTitle: string;
|
||||
buttonTitle: string;
|
||||
onClose: () => void;
|
||||
onConfirm: (password: string) => Promise<void>;
|
||||
}) => {
|
||||
@@ -27,7 +31,7 @@ export const ConfirmPasswordModal = ({
|
||||
>
|
||||
<Paper>
|
||||
<DialogTitle>
|
||||
<Typography variant="h6">Switch account</Typography>
|
||||
<Typography variant="h6">{modalTitle}</Typography>
|
||||
<Typography fontSize="small" sx={{ color: 'grey.600' }}>
|
||||
Confirm password
|
||||
</Typography>
|
||||
@@ -36,7 +40,7 @@ export const ConfirmPasswordModal = ({
|
||||
onConfirm={onConfirm}
|
||||
error={error}
|
||||
isLoading={isLoading}
|
||||
buttonTitle="Switch account"
|
||||
buttonTitle={buttonTitle}
|
||||
onCancel={onClose}
|
||||
/>
|
||||
</Paper>
|
||||
|
||||
Reference in New Issue
Block a user