import { View } from 'react-native'; import { Pressable, Text } from 'native-base'; import React from 'react'; type TabNavigationButtonProps = { icon?: React.ReactNode; label: string; onPress: () => void; onLongPress: () => void; isActive: boolean; isCollapsed: boolean; }; const TabNavigationButton = (props: TabNavigationButtonProps) => { return ( {({ isPressed, isHovered }) => { let boxShadow: string | undefined = undefined; if (isHovered) { boxShadow = '0px 0px 16px 0px rgba(0, 0, 0, 0.25)'; } else if (props.isActive) { boxShadow = '0px 0px 8px 0px rgba(0, 0, 0, 0.25)'; } return ( { if (isPressed) { return 'rgba(0, 0, 0, 0.1)'; } else if (isHovered) { return 'rgba(231, 231, 232, 0.2)'; } else if (props.isActive) { return 'rgba(16, 16, 20, 0.5)'; } else { return 'transparent'; } })(), }} > {props.icon && ( {props.icon} )} {!props.isCollapsed && ( {props.label} )} ); }} ); }; TabNavigationButton.defaultProps = { icon: undefined, onPress: () => {}, onLongPress: () => {}, isActive: false, isCollapsed: false, }; export default TabNavigationButton;