( props: Props, )
| 38 | }; |
| 39 | |
| 40 | function createChatTabBarButton<Route: NUXTipRouteNames>( |
| 41 | props: Props, |
| 42 | ): React.ComponentType<NUXTipsOverlayProps<Route>> { |
| 43 | function ChatTabBarButton(): React.Node { |
| 44 | const { title, tabBarIcon: Icon } = props; |
| 45 | |
| 46 | const position = React.useRef(new Animated.Value(0)); |
| 47 | const route = useRoute(); |
| 48 | |
| 49 | const activeTheme = useSelector(state => state.globalThemeInfo.activeTheme); |
| 50 | const color = React.useMemo( |
| 51 | () => |
| 52 | activeTheme === 'dark' ? DarkTheme.colors.text : LightTheme.colors.text, |
| 53 | [activeTheme], |
| 54 | ); |
| 55 | |
| 56 | const styles = useStyles(unboundStyles); |
| 57 | |
| 58 | const renderLabel = React.useCallback( |
| 59 | ({ color: labelColor }: { color: string, ... }) => { |
| 60 | return ( |
| 61 | <Text style={[styles.label, { color: labelColor }]}>{title}</Text> |
| 62 | ); |
| 63 | }, |
| 64 | [styles.label, title], |
| 65 | ); |
| 66 | |
| 67 | const renderIcon = React.useCallback( |
| 68 | ({ color: iconColor }: { color: string, ... }) => { |
| 69 | return ( |
| 70 | <View style={styles.icon}> |
| 71 | <Icon color={iconColor} /> |
| 72 | </View> |
| 73 | ); |
| 74 | }, |
| 75 | [Icon, styles.icon], |
| 76 | ); |
| 77 | |
| 78 | const renderLabelText = React.useCallback(() => title, [title]); |
| 79 | |
| 80 | return ( |
| 81 | <TabBarItem |
| 82 | position={position.current} |
| 83 | route={route} |
| 84 | navigationState={dummyNavigationState} |
| 85 | onPress={dummyCallback} |
| 86 | onLongPress={dummyCallback} |
| 87 | style={styles.button} |
| 88 | getLabelText={renderLabelText} |
| 89 | getAccessible={dummyCallback} |
| 90 | getAccessibilityLabel={dummyCallback} |
no outgoing calls
no test coverage detected