-
-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat/empty mobile passphrase (#12193)
* feat(suite-native): empty passphrase wallet UI * fixup! feat(suite-native): empty passphrase wallet UI * fixup! feat(suite-native): empty passphrase wallet UI
- Loading branch information
Showing
23 changed files
with
476 additions
and
39 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
109 changes: 109 additions & 0 deletions
109
suite-native/module-passphrase/src/components/EmptyWalletInfoSheet.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,109 @@ | ||
import { useNavigation } from '@react-navigation/native'; | ||
|
||
import { Icon, IconName } from '@suite-common/icons'; | ||
import { TxKeyPath } from '@suite-native/intl'; | ||
import { | ||
AlertBox, | ||
BottomSheet, | ||
Box, | ||
Button, | ||
HStack, | ||
Pictogram, | ||
Text, | ||
VStack, | ||
} from '@suite-native/atoms'; | ||
import { Translation } from '@suite-native/intl'; | ||
import { prepareNativeStyle, useNativeStyles } from '@trezor/styles'; | ||
import { | ||
PassphraseStackParamList, | ||
PassphraseStackRoutes, | ||
RootStackParamList, | ||
StackToStackCompositeNavigationProps, | ||
} from '@suite-native/navigation'; | ||
|
||
type EmptyWalletInfoSheetProps = { | ||
onClose: () => void; | ||
isVisible: boolean; | ||
}; | ||
|
||
const buttonWrapperStyle = prepareNativeStyle(() => ({ | ||
width: '100%', | ||
})); | ||
|
||
const listItemStyle = prepareNativeStyle(() => ({ | ||
width: '90%', | ||
})); | ||
|
||
const ListItem = ({ | ||
iconName, | ||
translationKey, | ||
}: { | ||
iconName: IconName; | ||
translationKey: TxKeyPath; | ||
}) => { | ||
const { applyStyle } = useNativeStyles(); | ||
|
||
return ( | ||
<HStack spacing={20}> | ||
<Icon name={iconName} /> | ||
<Text style={applyStyle(listItemStyle)}> | ||
<Translation id={translationKey} /> | ||
</Text> | ||
</HStack> | ||
); | ||
}; | ||
|
||
type NavigationProp = StackToStackCompositeNavigationProps< | ||
PassphraseStackParamList, | ||
PassphraseStackRoutes.PassphraseEmptyWallet, | ||
RootStackParamList | ||
>; | ||
|
||
export const EmptyWalletInfoSheet = ({ onClose, isVisible }: EmptyWalletInfoSheetProps) => { | ||
const navigation = useNavigation<NavigationProp>(); | ||
|
||
const { applyStyle } = useNativeStyles(); | ||
|
||
const handleOpenEmptyWallet = () => { | ||
navigation.navigate(PassphraseStackRoutes.PassphraseVerifyEmptyWallet); | ||
onClose(); | ||
}; | ||
|
||
return ( | ||
<BottomSheet isVisible={isVisible} onClose={onClose} isCloseDisplayed={false}> | ||
<VStack alignItems="center" spacing="large" padding="medium"> | ||
<Pictogram variant="yellow" icon="warningTriangleLight" /> | ||
<VStack spacing="medium"> | ||
<Text variant="titleSmall"> | ||
<Translation id="modulePassphrase.emptyPassphraseWallet.confirmEmptyWalletSheet.title" /> | ||
</Text> | ||
<VStack spacing={12}> | ||
<ListItem | ||
iconName="pencilUnderscored" | ||
translationKey="modulePassphrase.emptyPassphraseWallet.confirmEmptyWalletSheet.list.backup" | ||
/> | ||
<ListItem | ||
iconName="copy" | ||
translationKey="modulePassphrase.emptyPassphraseWallet.confirmEmptyWalletSheet.list.store" | ||
/> | ||
<ListItem | ||
iconName="eyeSlashLight" | ||
translationKey="modulePassphrase.emptyPassphraseWallet.confirmEmptyWalletSheet.list.neverShare" | ||
/> | ||
</VStack> | ||
<AlertBox | ||
variant="warning" | ||
title={ | ||
<Translation id="modulePassphrase.emptyPassphraseWallet.confirmEmptyWalletSheet.alertTitle" /> | ||
} | ||
/> | ||
</VStack> | ||
<Box style={applyStyle(buttonWrapperStyle)}> | ||
<Button onPress={handleOpenEmptyWallet}> | ||
<Translation id="modulePassphrase.emptyPassphraseWallet.confirmEmptyWalletSheet.button" /> | ||
</Button> | ||
</Box> | ||
</VStack> | ||
</BottomSheet> | ||
); | ||
}; |
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
Oops, something went wrong.