MCPcopy Create free account
hub / github.com/CommE2E/comm / createChatTabBarButton

Function createChatTabBarButton

native/navigation/chat-tab-bar-button.react.js:40–87  ·  view source on GitHub ↗
(
  props: Props,
)

Source from the content-addressed store, hash-verified

38};
39
40function 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}

Callers 2

MutedTabTipFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected