diff --git a/native/chat/inline-engagement.react.js b/native/chat/inline-engagement.react.js
--- a/native/chat/inline-engagement.react.js
+++ b/native/chat/inline-engagement.react.js
@@ -1,5 +1,6 @@
// @flow
+import { useNavigation } from '@react-navigation/native';
import * as React from 'react';
import { Text, View } from 'react-native';
import Animated, {
@@ -14,6 +15,7 @@
import CommIcon from '../components/comm-icon.react';
import GestureTouchableOpacity from '../components/gesture-touchable-opacity.react';
+import { MessageReactionsModalRouteName } from '../navigation/route-names';
import { useStyles } from '../themes/colors';
import type { ChatMessageInfoItemWithHeight } from '../types/chat-types';
import {
@@ -34,13 +36,57 @@
const repliesText = useInlineEngagementText(threadInfo);
const navigateToThread = useNavigateToThread();
- const onPress = React.useCallback(() => {
+ const { navigate } = useNavigation();
+
+ const styles = useStyles(unboundStyles);
+
+ const unreadStyle = threadInfo?.currentUser.unread ? styles.unread : null;
+ const repliesStyles = React.useMemo(() => [styles.repliesText, unreadStyle], [
+ styles.repliesText,
+ unreadStyle,
+ ]);
+
+ const onPressThread = React.useCallback(() => {
if (threadInfo && !disabled) {
navigateToThread({ threadInfo });
}
}, [disabled, navigateToThread, threadInfo]);
- const styles = useStyles(unboundStyles);
+ const noThreadInfo = !threadInfo;
+ const sidebarItem = React.useMemo(() => {
+ if (noThreadInfo) {
+ return null;
+ }
+ return (
+
+
+ {repliesText}
+
+ );
+ }, [
+ noThreadInfo,
+ onPressThread,
+ styles.sidebar,
+ styles.icon,
+ repliesStyles,
+ repliesText,
+ ]);
+
+ const onPressReactions = React.useCallback(() => {
+ navigate<'MessageReactionsModal'>({
+ name: MessageReactionsModalRouteName,
+ params: { reactions },
+ });
+ }, [navigate, reactions]);
+
+ const marginLeft = React.useMemo(
+ () => (sidebarItem ? styles.reactionMarginLeft : null),
+ [sidebarItem, styles.reactionMarginLeft],
+ );
const reactionList = React.useMemo(() => {
if (!reactions || reactions.size === 0) {
@@ -50,37 +96,27 @@
const reactionText = stringForReactionList(reactions);
const reactionItems = {reactionText};
- return {reactionItems};
- }, [reactions, styles.reaction, styles.reactionsContainer]);
-
- const unreadStyle = threadInfo?.currentUser.unread ? styles.unread : null;
- const marginRight = reactionList ? styles.repliesMarginRight : null;
- const repliesStyles = React.useMemo(
- () => [marginRight, styles.repliesText, unreadStyle],
- [marginRight, styles.repliesText, unreadStyle],
- );
- const noThreadInfo = !threadInfo;
- const sidebarInfo = React.useMemo(() => {
- if (noThreadInfo) {
- return null;
- }
return (
- <>
-
- {repliesText}
- >
- );
- }, [noThreadInfo, styles.icon, repliesStyles, repliesText]);
- return (
-
- {sidebarInfo}
- {reactionList}
+ {reactionItems}
+ );
+ }, [
+ marginLeft,
+ onPressReactions,
+ reactions,
+ styles.reaction,
+ styles.reactionsContainer,
+ ]);
+
+ return (
+
+ {sidebarItem}
+ {reactionList}
);
}
@@ -89,8 +125,11 @@
container: {
flexDirection: 'row',
height: inlineEngagementStyle.height,
- display: 'flex',
borderRadius: 16,
+ backgroundColor: 'inlineEngagementBackground',
+ alignSelf: 'baseline',
+ alignItems: 'center',
+ padding: 8,
},
unread: {
color: 'listForegroundLabel',
@@ -98,13 +137,7 @@
},
sidebar: {
flexDirection: 'row',
- display: 'flex',
alignItems: 'center',
- justifyContent: 'center',
- backgroundColor: 'inlineEngagementBackground',
- padding: 8,
- borderRadius: 16,
- height: inlineEngagementStyle.height,
},
icon: {
color: 'inlineEngagementLabel',
@@ -115,17 +148,18 @@
fontSize: 14,
lineHeight: 22,
},
- repliesMarginRight: {
- marginRight: 12,
- },
reaction: {
- marginLeft: 4,
color: 'inlineEngagementLabel',
+ fontSize: 14,
+ lineHeight: 22,
+ },
+ reactionMarginLeft: {
+ marginLeft: 12,
},
reactionsContainer: {
display: 'flex',
flexDirection: 'row',
- marginLeft: -4,
+ alignItems: 'center',
},
};
diff --git a/native/navigation/root-navigator.react.js b/native/navigation/root-navigator.react.js
--- a/native/navigation/root-navigator.react.js
+++ b/native/navigation/root-navigator.react.js
@@ -21,6 +21,7 @@
import TermsAndPrivacyModal from '../account/terms-and-privacy-modal.react';
import ThreadPickerModal from '../calendar/thread-picker-modal.react';
import ImagePasteModal from '../chat/image-paste-modal.react';
+import MessageReactionsModal from '../chat/message-reactions-modal.react';
import AddUsersModal from '../chat/settings/add-users-modal.react';
import ColorSelectorModal from '../chat/settings/color-selector-modal.react';
import ComposeSubchannelModal from '../chat/settings/compose-subchannel-modal.react';
@@ -44,6 +45,7 @@
ComposeSubchannelModalRouteName,
SidebarListModalRouteName,
SubchannelsListModalRouteName,
+ MessageReactionsModalRouteName,
type ScreenParamList,
type RootParamList,
TermsAndPrivacyRouteName,
@@ -235,6 +237,11 @@
component={SubchannelsListModal}
options={modalOverlayScreenOptions}
/>
+
);
}