-
Notifications
You must be signed in to change notification settings - Fork 465
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Create Safe] feat: Status view redesign (#1018)
* feat: Implement create safe status redesign * style: Add animated loading spinner * fix: Simplify conditions * add: animate into css safe logo * fix: use numeric enum for simpler conditions, adjust animated logo sizes * fix: Display dialog after safe creation * fix: Feedback * fix: Better name for query param Co-authored-by: schmanu <manu@safe.global>
- Loading branch information
1 parent
6b05e27
commit 872f5f9
Showing
24 changed files
with
1,246 additions
and
117 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import React, { type ElementType } from 'react' | ||
import { Box, Button, Dialog, DialogContent, Grid, SvgIcon, Typography } from '@mui/material' | ||
|
||
import HomeIcon from '@/public/images/sidebar/home.svg' | ||
import TransactionIcon from '@/public/images/sidebar/transactions.svg' | ||
import AppsIcon from '@/public/images/sidebar/apps.svg' | ||
import SettingsIcon from '@/public/images/sidebar/settings.svg' | ||
import BeamerIcon from '@/public/images/sidebar/whats-new.svg' | ||
import HelpCenterIcon from '@/public/images/sidebar/help-center.svg' | ||
|
||
const HintItem = ({ Icon, title, description }: { Icon: ElementType; title: string; description: string }) => { | ||
return ( | ||
<Grid item md={6}> | ||
<Box display="flex" alignItems="center" gap={1} mb={1}> | ||
<SvgIcon component={Icon} inheritViewBox fontSize="small" /> | ||
<Typography variant="subtitle2" fontWeight="700"> | ||
{title} | ||
</Typography> | ||
</Box> | ||
|
||
<Typography variant="body2">{description}</Typography> | ||
</Grid> | ||
) | ||
} | ||
|
||
const CreationDialog = () => { | ||
const [open, setOpen] = React.useState(true) | ||
|
||
return ( | ||
<Dialog open={open}> | ||
<DialogContent sx={{ paddingX: 8, paddingTop: 9, paddingBottom: 6 }}> | ||
<Typography variant="h3" fontWeight="700" mb={1}> | ||
Welcome to your Safe! | ||
</Typography> | ||
<Typography variant="body2"> | ||
Congratulations on creating the safest wallet in web3. Keep your assets safe and discover our app. | ||
</Typography> | ||
<Grid container mt={4} mb={6} spacing={3}> | ||
<HintItem | ||
Icon={HomeIcon} | ||
title="Home" | ||
description="Get a status overview of your Safe and more on your Safe homepage." | ||
/> | ||
<HintItem | ||
Icon={TransactionIcon} | ||
title="Transactions" | ||
description="Review, approve, execute and keep track of asset movement." | ||
/> | ||
<HintItem | ||
Icon={AppsIcon} | ||
title="Apps" | ||
description="Over 70 dApps available for you on Mainnet. Check out Safe apps for secure integrations. " | ||
/> | ||
<HintItem | ||
Icon={SettingsIcon} | ||
title="Settings" | ||
description="Want to change your Safe setup? Settings is the right place to go." | ||
/> | ||
<HintItem Icon={BeamerIcon} title="What's new" description="Don't miss any future Safe updates." /> | ||
<HintItem | ||
Icon={HelpCenterIcon} | ||
title="Help center" | ||
description="Have any questions? Check out our collection of articles. " | ||
/> | ||
</Grid> | ||
<Box display="flex" justifyContent="center"> | ||
<Button onClick={() => setOpen(false)} variant="contained" size="stretched"> | ||
Got it | ||
</Button> | ||
</Box> | ||
</DialogContent> | ||
</Dialog> | ||
) | ||
} | ||
|
||
export default CreationDialog |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { useEffect } from 'react' | ||
import useLocalStorage from '@/services/local-storage/useLocalStorage' | ||
import type { StepRenderProps } from '@/components/new-safe/CardStepper/useCardStepper' | ||
import type { PendingSafeData } from '@/components/new-safe/steps/Step4' | ||
import type { NewSafeFormData } from '@/components/new-safe/CreateSafe/index' | ||
import { SAFE_PENDING_CREATION_STORAGE_KEY } from '@/components/new-safe/steps/Step4' | ||
|
||
const useSetCreationStep = (setStep: StepRenderProps<NewSafeFormData>['setStep'], isConnected: boolean) => { | ||
const [pendingSafe] = useLocalStorage<PendingSafeData | undefined>(SAFE_PENDING_CREATION_STORAGE_KEY) | ||
|
||
useEffect(() => { | ||
if (!isConnected) { | ||
setStep(0) | ||
} | ||
|
||
// Jump to the status screen if there is already a tx submitted | ||
if (pendingSafe) { | ||
setStep(4) | ||
} | ||
}, [isConnected, setStep, pendingSafe]) | ||
} | ||
|
||
export default useSetCreationStep |
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
Oops, something went wrong.