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

Function ComposeThreadButton

native/chat/compose-thread-button.react.js:19–50  ·  view source on GitHub ↗
(props: Props)

Source from the content-addressed store, hash-verified

17 +navigate: ChatNavigationProp<'ChatThreadList'>['navigate'],
18};
19function ComposeThreadButton(props: Props) {
20 const { navigate } = props;
21 const loggedInUserInfo = useLoggedInUserInfo();
22 const onPress = React.useCallback(() => {
23 if (!loggedInUserInfo) {
24 return;
25 }
26 navigate<'MessageList'>({
27 name: MessageListRouteName,
28 params: {
29 threadInfo: createPendingThread({
30 viewerID: loggedInUserInfo.id,
31 threadType: threadTypes.PRIVATE,
32 members: [loggedInUserInfo],
33 }),
34 searching: true,
35 },
36 });
37 }, [loggedInUserInfo, navigate]);
38
39 const { listForegroundSecondaryLabel } = useColors();
40 return (
41 <Button onPress={onPress} androidBorderlessRipple={true}>
42 <SWMansionIcon
43 name="edit-4"
44 size={26}
45 style={styles.composeButton}
46 color={listForegroundSecondaryLabel}
47 />
48 </Button>
49 );
50}
51
52const styles = StyleSheet.create({
53 composeButton: {

Callers

nothing calls this directly

Calls 3

useLoggedInUserInfoFunction · 0.90
createPendingThreadFunction · 0.90
useColorsFunction · 0.90

Tested by

no test coverage detected