Skip to content
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

feat: new wallet flow for native #8597

Merged
merged 37 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
1133808
[skip ci] wip: new wallet flow for native
gomesalexandre Jan 15, 2025
6da6baa
[skip ci] feat: handlers
gomesalexandre Jan 15, 2025
d7b51a1
feat: stopping point
gomesalexandre Jan 16, 2025
0797e59
Merge branch 'develop' into feat_new_wallet_flow_native
gomesalexandre Jan 16, 2025
01142ec
[skip ci] chore: one too deep on the cleanup
gomesalexandre Jan 16, 2025
40ec15c
feat: progression
gomesalexandre Jan 16, 2025
5485c88
fix: routing shenanigans
gomesalexandre Jan 16, 2025
1f3882b
fix: more routing shenanigans
gomesalexandre Jan 16, 2025
f2ce7ab
feat: missing routes
gomesalexandre Jan 16, 2025
718dc3a
fix: styles
gomesalexandre Jan 16, 2025
8110223
fix: more style fixes
gomesalexandre Jan 16, 2025
4c83aa9
[skip ci] wip: more wire more up
gomesalexandre Jan 16, 2025
27cf208
fix: routing
gomesalexandre Jan 16, 2025
9a1ea6a
feat: rm disgusting iiafe
gomesalexandre Jan 16, 2025
956f522
chore: trigger CI
gomesalexandre Jan 16, 2025
b8a2e8a
fix: lint
gomesalexandre Jan 16, 2025
c910f7f
fix: light mode things
gomesalexandre Jan 16, 2025
6d0a12e
feat: less aggressive light mode
gomesalexandre Jan 16, 2025
489ecb7
fix: mobile things
gomesalexandre Jan 16, 2025
ae6dc60
fix: lint
gomesalexandre Jan 16, 2025
5838748
feat: progress
gomesalexandre Jan 16, 2025
b95c538
fix: tests with flag on
gomesalexandre Jan 16, 2025
2e8d382
feat: more progress more ion
gomesalexandre Jan 16, 2025
17adcab
feat: add divider
gomesalexandre Jan 16, 2025
6830ce4
fix: scrolly bits
gomesalexandre Jan 16, 2025
f60cafc
feat: truncate long-ass wallet names
gomesalexandre Jan 16, 2025
50cfde3
feat: slightly adjust styles
gomesalexandre Jan 16, 2025
e945fcb
feat: almost there
gomesalexandre Jan 16, 2025
d9f739c
Merge branch 'develop' into feat_new_wallet_flow_native
gomesalexandre Jan 16, 2025
381c8a2
feat: here we fuarking go
gomesalexandre Jan 16, 2025
1604511
feat: cleanup
gomesalexandre Jan 16, 2025
84191d7
feat: more cleanup
gomesalexandre Jan 16, 2025
c46c1ee
feat: more cleanup
gomesalexandre Jan 16, 2025
7848539
feat: last cleanup i swear
gomesalexandre Jan 16, 2025
f7b4b16
Revert "feat: last cleanup i swear"
gomesalexandre Jan 16, 2025
52ae673
Merge branch 'develop' into feat_new_wallet_flow_native
NeOMakinG Jan 17, 2025
3234de0
feat: extract hdwalletNativeVaultsList queryKey / queryFn
gomesalexandre Jan 17, 2025
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
12 changes: 11 additions & 1 deletion src/assets/translations/en/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@
"activeAccount": "Active Account",
"update": "Update",
"apy": "APY",
"tbd": "TBD"
"tbd": "TBD",
"installed": "Installed"
},
"consentBanner": {
"body": {
Expand Down Expand Up @@ -1871,6 +1872,15 @@
"onboarding": {
"skip": "Skip",
"shapeshiftWallet": "ShapeShift Wallet",
"createNewWallet": "Create a new wallet",
"shapeshiftNative": "ShapeShift Native",
"addNewWallet": "Add new wallet",
"comingFromThorswap": "Coming from THORSwap?",
"importExisting": "Import existing",
"importFromKeystore": "Import from keystore",
"whatIsShapeshiftWallet": "What is ShapeShift Wallet?",
"yourDecentralizedGateway": "Your decentralization gateway. Trade and earn Bitcoin, Ethereum, Solana and more from a single, secure wallet.",
"crossChainFreedom": "Cross chain freedom. Access the best rates across multiple decentralized exchanges, no middleman required",
"selfCustody": {
"title": "Your ShapeShift Wallet is Self-Custody",
"subTitle": "You hold the keys and you're the only one who can access it.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const hoverSx = { borderColor: 'blue.500' }

// TODO(gomes): use https://www.chakra-ui.com/docs/components/file-upload if/when we migrate to chakra@3
const FileUpload = ({ onFileSelect }: { onFileSelect: (file: File) => void }) => {
const bgColor = useColorModeValue('gray.50', 'gray.800')
const borderColor = useColorModeValue('gray.200', 'gray.600')
const [isDragging, setIsDragging] = useState(false)
const [filename, setFilename] = useState<string | null>(null)
Expand Down Expand Up @@ -98,7 +97,7 @@ const FileUpload = ({ onFileSelect }: { onFileSelect: (file: File) => void }) =>
flexDirection='column'
alignItems='center'
justifyContent='center'
bg={bgColor}
bg='background.surface.raised.base'
cursor='pointer'
transition='all 0.2s'
_hover={hoverSx}
Expand Down
gomesalexandre marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const NativePassword = ({ history, location }: NativeSetupProps) => {
vault.seal()
await vault.setPassword(values.password)
vault.meta.set('name', values.name)

gomesalexandre marked this conversation as resolved.
Show resolved Hide resolved
history.push(NativeWalletRoutes.Success, { vault })
} catch (e) {
console.error(e)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
import { Box, ModalBody, ModalHeader } from '@chakra-ui/react'
import { useQueryClient } from '@tanstack/react-query'
import { reactQueries } from 'react-queries'
import { Text } from 'components/Text'

import { useNativeSuccess } from '../hooks/useNativeSuccess'
import type { NativeSetupProps } from '../types'

export const NativeSuccess = ({ location }: NativeSetupProps) => {
const queryClient = useQueryClient()
const { isSuccessful } = useNativeSuccess({ vault: location.state.vault })

queryClient.invalidateQueries({
queryKey: reactQueries.common.hdwalletNativeVaultsList().queryKey,
})

return (
<>
<ModalHeader>
Expand Down
2 changes: 1 addition & 1 deletion src/context/WalletProvider/NativeWallet/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { NativeAdapter } from '@shapeshiftoss/hdwallet-native'
import { FoxIcon } from 'components/Icons/FoxIcon' // Ensure the import path is correct
import { FoxIcon } from 'components/Icons/FoxIcon'
import type { SupportedWalletInfo } from 'context/WalletProvider/config'

type NativeConfigType = Omit<SupportedWalletInfo<typeof NativeAdapter>, 'routes'>
Expand Down
12 changes: 1 addition & 11 deletions src/context/WalletProvider/NativeWallet/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import type { Vault } from '@shapeshiftoss/hdwallet-native-vault'
import type React from 'react'
import type { RouteComponentProps } from 'react-router-dom'
import type { ActionTypes } from 'context/WalletProvider/actions'

export type NativeWalletValues = {
name: string
Expand All @@ -22,12 +20,4 @@ export interface LocationState {
}
}

export interface NativeSetupProps
extends RouteComponentProps<
{},
any, // history
LocationState
> {
vault: Vault
dispatch: React.Dispatch<ActionTypes>
}
export type NativeSetupProps = RouteComponentProps<{}, any, LocationState>
gomesalexandre marked this conversation as resolved.
Show resolved Hide resolved
Loading