import {useTheme} from '../../theme/ThemeProvider'; import {memo} from 'react'; import {Pressable, StyleSheet, Text, View} from 'react-native'; import {renderIcon} from '../../helpers/renderIcon'; import type {NavigationItemProps} from '../../types'; import {SelectedTab} from './SelectedTab'; const NavigationItemComponent = (props: NavigationItemProps) => { const {colors} = useTheme(); const { item, index, highlightedBgColor, iconColor, iconSize = 25, selected, selectedColor = colors.primary, selectedheight, testID, textColor, textStyle, onPress, } = props; const {highlighted, icon, text} = item; return ( onPress?.(index)} style={styles.button}> {!highlighted && selected && ( )} {renderIcon(icon, { size: highlighted ? iconSize + 5 : iconSize, color: iconColor, })} {!highlighted && ( {text} )} ); }; export const NavigationItem = memo(NavigationItemComponent); const styles = StyleSheet.create({ button: { justifyContent: 'center', alignItems: 'center', flex: 1, }, content: { paddingTop: 10, }, text: { paddingHorizontal: 3, }, highlighted: { padding: 10, borderRadius: 50, position: 'absolute', }, });