-
Notifications
You must be signed in to change notification settings - Fork 476
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/import signers #4857
base: dev
Are you sure you want to change the base?
Feat/import signers #4857
Conversation
…resentational layer
Branch preview✅ Deploy successful! Storybook: |
Coverage (44%)
|
<Stack.Screen | ||
name="import-signers/import-private-key" | ||
options={{ headerShown: true, title: '' }} | ||
/> | ||
<Stack.Screen | ||
name="import-signers/import-private-key-success" | ||
options={{ | ||
presentation: 'modal', | ||
headerShown: false, | ||
}} | ||
/> | ||
<Stack.Screen | ||
name="import-signers/loading-import" | ||
options={{ | ||
presentation: 'modal', | ||
headerShown: false, | ||
}} | ||
/> | ||
<Stack.Screen | ||
name="import-signers/import-private-key-error" | ||
options={{ | ||
presentation: 'modal', | ||
headerShown: false, | ||
}} | ||
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a nit.
We'll have quite some typing with those names.
the folder name is import-signers. Repeating import in the file name afterwards looks redundant.
import-signers/private-key
import-signers/private-key-success
import-signers/loading
import-signers/private-key-error
convey the same meaning in my opinion.
const items = [ | ||
{ | ||
name: 'seed', | ||
title: 'Import seed phrase or a private key', | ||
description: 'Enter a private key or a 12-24 word seed phrase.', | ||
icon: <SafeFontIcon name="wallet" size={16} />, | ||
Image: Seed, | ||
imageProps: { marginBottom: -31 }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is it -31 here and -48 for the next image. Is this going to look ok on a smaller, bigger display? I guess you are adding those because of the safe area?
jest.mock('@/src/navigation/useScrollableHeader', () => ({ | ||
useScrollableHeader: () => ({ | ||
handleScroll: jest.fn(), | ||
}), | ||
})) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we should move this to a global mock. We have a lot of screens with this hook now.
act(() => fireEvent.press(button)) | ||
|
||
await waitFor(() => { | ||
expect(screen.getByTestId('safe-input').props.style.borderTopColor).toBe('#FF5F72') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this. I see that we did the same in the SafeWalletInput PR, but the problem is that the moment we go for a different border color those tests will fail. I think that instead we should read the color variable in tamagui here.
<ScrollView contentContainerStyle={{ flexGrow: 1 }}> | ||
<View flex={1} flexGrow={1} alignItems="center" justifyContent="center" paddingHorizontal="$3"> | ||
<View flexDirection="row" alignItems="center" gap="$3"> | ||
<Identicon address="0x0000000000000000000000000000000000000000" size={64} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we generating an identicon of the 0x0 address? Later we say - the address is not a signer of this account. I would expect that we generate an identicon from the provided private key
|
||
<Badge | ||
circleProps={{ backgroundColor: '#2F2527' }} | ||
themeName="badge_success" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
badge success on error page?
const { data } = useSafesGetSafeV1Query({ | ||
safeAddress: activeSafe.address, | ||
chainId: activeSafe.chainId, | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if that call fails with a network error? And why do we need to do a network request here? How did we get to the import page? We start from a safe, so we most probably have the safe in the store, no?
"packageManager": "[email protected]" | ||
"packageManager": "[email protected]", | ||
"dependencies": { | ||
"expo-linear-gradient": "~14.0.2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this must be some kind of a mistake. It should be in apps/mobile
What it solves
It creates the import signers flow.
How to test it
Checklist