-
Notifications
You must be signed in to change notification settings - Fork 428
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add cancellation overview (#2855)
* fix: add overview of cancellation + skip -> cancel * fix: icon colour
- Loading branch information
Showing
10 changed files
with
102 additions
and
34 deletions.
There are no files selected for viewing
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
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
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
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
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
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
43 changes: 43 additions & 0 deletions
43
src/components/tx-flow/flows/CancelRecovery/CancelRecoveryOverview.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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { Box, Button, Typography } from '@mui/material' | ||
import { useContext } from 'react' | ||
import type { ReactElement } from 'react' | ||
|
||
import ReplaceTxIcon from '@/public/images/transactions/replace-tx.svg' | ||
import { TxModalContext } from '../..' | ||
import TxCard from '../../common/TxCard' | ||
|
||
export function CancelRecoveryOverview({ onSubmit }: { onSubmit: () => void }): ReactElement { | ||
const { setTxFlow } = useContext(TxModalContext) | ||
|
||
const onClose = () => { | ||
setTxFlow(undefined) | ||
} | ||
|
||
return ( | ||
<TxCard> | ||
<Box display="flex" flexDirection="column" alignItems="center" p={5}> | ||
{/* TODO: Replace with correct icon when provided */} | ||
<ReplaceTxIcon /> | ||
|
||
<Typography mb={1} variant="h4" mt={5} fontWeight={700}> | ||
Do you want to cancel the Account recovery? | ||
</Typography> | ||
|
||
<Typography variant="body2" mb={3} textAlign="center"> | ||
If it is was an unwanted recovery attempt or you've noticed something suspicious, you can cancel it by | ||
increasing the nonce of the recovery module. | ||
</Typography> | ||
|
||
<Box display="flex" gap={3}> | ||
<Button variant="outlined" onClick={onClose}> | ||
Go back | ||
</Button> | ||
|
||
<Button variant="contained" onClick={onSubmit}> | ||
Yes, cancel recovery | ||
</Button> | ||
</Box> | ||
</Box> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import type { ReactElement } from 'react' | ||
|
||
import TxLayout from '../../common/TxLayout' | ||
import { CancelRecoveryFlowReview } from './CancelRecoveryFlowReview' | ||
import { CancelRecoveryOverview } from './CancelRecoveryOverview' | ||
import useTxStepper from '../../useTxStepper' | ||
import type { RecoveryQueueItem } from '@/store/recoverySlice' | ||
|
||
export function CancelRecoveryFlow({ recovery }: { recovery: RecoveryQueueItem }): ReactElement { | ||
const { step, nextStep, prevStep } = useTxStepper<undefined>(undefined) | ||
|
||
const steps = [ | ||
<CancelRecoveryOverview key={0} onSubmit={() => nextStep(undefined)} />, | ||
<CancelRecoveryFlowReview key={0} recovery={recovery} />, | ||
] | ||
|
||
const isIntro = step === 0 | ||
|
||
return ( | ||
<TxLayout | ||
title={isIntro ? 'Cancel Account recovery' : 'New transaction'} | ||
subtitle={isIntro ? undefined : 'Cancel Account recovery'} | ||
step={step} | ||
hideNonce={isIntro} | ||
onBack={prevStep} | ||
> | ||
{steps} | ||
</TxLayout> | ||
) | ||
} |
This file was deleted.
Oops, something went wrong.
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