Skip to content

feat: new mobile wallet create flow #8760

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions src/assets/translations/en/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -1240,6 +1240,8 @@
"menuItem": "Back up my wallet",
"enterPassword": "Enter your password to continue",
"testTitle": "Verify Your Secret Recovery Phrase",
"title": "Confirm Backup",
"description": "Complete this quick test to confirm you’ve saved everything correctly.",
"confirm": {
"title": "Backup wallet",
"body": "Before you forget your wallet, would you like to back up your secret recovery phrase?",
Expand Down Expand Up @@ -1955,6 +1957,39 @@
"pair": "Unable to pair your wallet"
}
}
},
"create": {
"header": "Give your wallet a name",
"subHeader": "Choose a nickname for your wallet",
"walletName": "My New Wallet",
"saveLocally": "Your nickname is saved locally to your device.",
"visibleToYou": "It will only be visible to you.",
"button": "Continue"
},
"keepSafe": {
"headerStart": "Keep your",
"headerSecret": "Secret",
"headerEnd": "Recovery Phrase Safe",
"subHeader": "Ensuring the safety of your Secret Recovery Phrase is crucial.",
"description": "Treat your Secret Recovery Phrase like you would your most valuable possession – keep it secure at all times. A password manager is great security, writing the words down is even better.",
"bulletPoints": {
"share": "Don't share it with anyone else",
"lose": "If you lose it, we can't recover it"
},
"button": "Continue to Backup"
},
"manualBackup": {
"header": "Manual Backup",
"subHeader": "Save your Secret Recovery Phrase in a secure place that only you control.",
"copyToClipboard": "Copy to clipboard",
"copied": "Copied!",
"nextStep": "Next you'll be asked to confirm the positions of certain words in your Secret Recovery Phrase.",
"button": "Continue backup",
"success": {
"title": "Manual Backup Complete",
"description": "Your wallet has been successfully backed up.",
"viewWallet": "View Wallet"
}
}
},
"graph": {
Expand Down
22 changes: 15 additions & 7 deletions src/components/CarouselDots/CarouselDots.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import { Box, Flex, Link, useColorModeValue } from '@chakra-ui/react'
import { Box, Flex, Link } from '@chakra-ui/react'

type CarouselDotsProps = {
length: number
activeIndex: number
onClick: (newActiveIndex: number) => void
onClick?: (newActiveIndex: number) => void
activeDotBackgroundColor?: string
inactiveDotBackgroundColor?: string
}

export const CarouselDots = ({ length, activeIndex, onClick }: CarouselDotsProps) => {
const activeDotBackgroundColor = useColorModeValue('black', 'white')

export const CarouselDots = ({
length,
activeIndex,
onClick,
activeDotBackgroundColor = 'blue.500',
inactiveDotBackgroundColor = 'text.subtle',
}: CarouselDotsProps) => {
return (
<Flex justifyContent='space-between'>
{new Array(length).fill(undefined).map((_, i) => (
Expand All @@ -18,10 +24,12 @@ export const CarouselDots = ({ length, activeIndex, onClick }: CarouselDotsProps
width='7px'
height='7px'
borderRadius='50%'
backgroundColor={i === activeIndex - 1 ? activeDotBackgroundColor : 'text.subtle'}
backgroundColor={
i === activeIndex - 1 ? activeDotBackgroundColor : inactiveDotBackgroundColor
}
// we need to pass an arg here, so we need an anonymous function wrapper
// eslint-disable-next-line react-memo/require-usememo
onClick={_ => onClick(i + 1)}
onClick={() => onClick?.(i + 1)}
/>
))}
</Flex>
Expand Down
8 changes: 8 additions & 0 deletions src/components/MobileWalletDialog/MobileWalletDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { AnimatePresence } from 'framer-motion'
import { MemoryRouter, Redirect, Route, Switch } from 'react-router'
import { Dialog } from 'components/Modal/components/Dialog'

import { CreateRouter } from './routes/CreateWallet/CreateRouter'
import { ManualBackup } from './routes/CreateWallet/ManualBackup'
import { DeleteWallet } from './routes/DeleteWallet/DeleteWallet'
import { RenameWallet } from './routes/RenameWallet'
import { SavedWallets } from './routes/SavedWallets'
Expand All @@ -20,6 +22,9 @@ export const MobileWalletDialog: React.FC<MobileWalletDialogProps> = ({ isOpen,
{({ location }) => (
<AnimatePresence mode='wait' initial={false}>
<Switch key={location.key} location={location}>
<Route path={MobileWalletDialogRoutes.Backup}>
<ManualBackup showContinueButton={false} />
</Route>
<Route path={MobileWalletDialogRoutes.Saved}>
<SavedWallets onClose={onClose} />
</Route>
Expand All @@ -29,6 +34,9 @@ export const MobileWalletDialog: React.FC<MobileWalletDialogProps> = ({ isOpen,
<Route path={MobileWalletDialogRoutes.Delete}>
<DeleteWallet />
</Route>
<Route path={MobileWalletDialogRoutes.Create}>
<CreateRouter onClose={onClose} />
</Route>
<Redirect exact from='/' to={MobileWalletDialogRoutes.Saved} />
</Switch>
</AnimatePresence>
Expand Down
Loading