(props: Props)
| 17 | +navigate: ChatNavigationProp<'ChatThreadList'>['navigate'], |
| 18 | }; |
| 19 | function 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 | |
| 52 | const styles = StyleSheet.create({ |
| 53 | composeButton: { |
nothing calls this directly
no test coverage detected