({ onPress })
| 12 | }; |
| 13 | |
| 14 | const 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 | |
| 51 | export default AddWalletButton; |
| 52 |
nothing calls this directly
no test coverage detected