MCPcopy
hub / github.com/BlueWallet/BlueWallet / AddWalletButton

Function AddWalletButton

components/AddWalletButton.tsx:14–49  ·  view source on GitHub ↗
({ onPress })

Source from the content-addressed store, hash-verified

12};
13
14const AddWalletButton: React.FC<AddWalletButtonProps> = ({ onPress }) => {
15 const { colors } = useTheme();
16 const navigation = useExtendedNavigation();
17
18 const onPressMenuItem = useCallback(
19 (action: string) => {
20 switch (action) {
21 case CommonToolTipActions.ImportWallet.id:
22 navigation.navigate('AddWalletRoot', { screen: 'ImportWallet' });
23 break;
24 default:
25 break;
26 }
27 },
28 [navigation],
29 );
30
31 const actions = useMemo(() => [CommonToolTipActions.ImportWallet], []);
32
33 return (
34 <ToolTipMenu
35 isButton
36 onPress={onPress}
37 buttonStyle={[styles.ball, { backgroundColor: colors.buttonBackgroundColor }]}
38 accessibilityRole="button"
39 accessibilityLabel={loc.wallets.add_title}
40 onPressMenuItem={onPressMenuItem}
41 actions={actions}
42 shouldOpenOnLongPress
43 >
44 <View style={styles.iconContainer}>
45 <Icon name="add" size={22} type="material" color={colors.foregroundColor} />
46 </View>
47 </ToolTipMenu>
48 );
49};
50
51export default AddWalletButton;
52

Callers

nothing calls this directly

Calls 2

useThemeFunction · 0.90
useExtendedNavigationFunction · 0.90

Tested by

no test coverage detected