-
Notifications
You must be signed in to change notification settings - Fork 456
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
88 additions
and
7 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 66 additions & 3 deletions
69
src/components/tx-flow/flows/EnableRecovery/EnableRecoveryFlowIntro.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,70 @@ | ||
import type { ReactElement } from 'react' | ||
import { Button, CardActions, Divider, Grid, Typography } from '@mui/material' | ||
import type { ReactElement, ReactNode } from 'react' | ||
|
||
import TxCard from '../../common/TxCard' | ||
import RecoveryGuardians from '@/public/images/settings/spending-limit/beneficiary.svg' | ||
import RecoveryGuardian from '@/public/images/transactions/recovery-guardian.svg' | ||
import RecoveryDelay from '@/public/images/settings/spending-limit/time.svg' | ||
import RecoveryExecution from '@/public/images/transactions/recovery-execution.svg' | ||
|
||
export function EnableRecoveryFlowIntro(): ReactElement { | ||
return <TxCard>EnableRecoveryFlowIntro</TxCard> | ||
import commonCss from '@/components/tx-flow/common/styles.module.css' | ||
|
||
const RecoverySteps: Array<{ icon: ReactElement; title: string; subtitle: ReactNode }> = [ | ||
{ | ||
icon: <RecoveryGuardians />, | ||
title: 'Choose a guardian and set a delay', | ||
subtitle: | ||
'Only your chosen guardian can initiate the recovery process. The process can be cancelled at any time during the delay period.', | ||
}, | ||
{ | ||
icon: <RecoveryGuardian />, | ||
title: 'Lost access? Let the guardian connect', | ||
subtitle: 'The recovery process can be initiated by a trusted guardian when connected to your Safe Account.', | ||
}, | ||
{ | ||
icon: <RecoveryDelay />, | ||
title: 'Start the recovery process', | ||
subtitle: ( | ||
<> | ||
Your <b>guardian</b> chooses new Safe Account owner(s) that you control and can initiates the recovery | ||
transaction. | ||
</> | ||
), | ||
}, | ||
{ | ||
icon: <RecoveryExecution />, | ||
title: 'All done! The Account is yours again', | ||
subtitle: | ||
'Once the delay period has passed, you can execute the recovery transaction and regain access to your Safe Account.', | ||
}, | ||
] | ||
|
||
export function EnableRecoveryFlowIntro({ onSubmit }: { onSubmit: () => void }): ReactElement { | ||
return ( | ||
<TxCard> | ||
<Grid container display="flex" gap={4}> | ||
{RecoverySteps.map(({ icon, title, subtitle }, index) => ( | ||
<Grid item xs={12} key={index}> | ||
<Grid container display="flex" gap={3}> | ||
<Grid item>{icon}</Grid> | ||
<Grid item xs> | ||
<Typography variant="h5" mb={0.5}> | ||
{title} | ||
</Typography> | ||
<Typography variant="body2">{subtitle}</Typography> | ||
</Grid> | ||
</Grid> | ||
</Grid> | ||
))} | ||
</Grid> | ||
|
||
<Divider className={commonCss.nestedDivider} /> | ||
|
||
<CardActions sx={{ mt: 'var(--space-1) !important' }}> | ||
<Button variant="contained" onClick={onSubmit}> | ||
Next | ||
</Button> | ||
</CardActions> | ||
</TxCard> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters