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 @@ -83,6 +83,18 @@ const repliesText = useInlineEngagementText(sidebarInfo); + const sidebarMargin = React.useMemo(() => { + if (!reactions || Object.keys(reactions).length === 0) { + return null; + } + + if (isRight) { + return styles.sidebarMarginLeft; + } else { + return styles.sidebarMarginRight; + } + }, [isRight, reactions, styles.sidebarMarginLeft, styles.sidebarMarginRight]); + const sidebarItem = React.useMemo(() => { if (!sidebarInfo) { return null; @@ -91,7 +103,7 @@ {repliesText} @@ -102,6 +114,7 @@ onPressSidebar, styles.sidebar, styles.icon, + sidebarMargin, repliesStyles, repliesText, ]); @@ -113,6 +126,17 @@ }); }, [navigate, reactions]); + const reactionsMargin = React.useMemo(() => { + if (isRight) { + return styles.reactionsContainerMarginLeft; + } + return styles.reactionsContainerMarginRight; + }, [ + isRight, + styles.reactionsContainerMarginLeft, + styles.reactionsContainerMarginRight, + ]); + const reactionList = React.useMemo(() => { if (!reactions || Object.keys(reactions).length === 0) { return null; @@ -122,7 +146,7 @@ const numOfReacts = reactions[reaction].users.length; return ( ); }); - }, [onPressReactions, reactions, styles.reaction, styles.reactionsContainer]); + }, [ + onPressReactions, + reactions, + reactionsMargin, + styles.reaction, + styles.reactionsContainer, + ]); const inlineEngagementPositionStyle = React.useMemo(() => { const styleResult = [styles.inlineEngagement]; @@ -182,6 +212,12 @@ borderRadius: 8, marginTop: inlineEngagementStyle.marginTop, }, + sidebarMarginLeft: { + marginLeft: 4, + }, + sidebarMarginRight: { + marginRight: 4, + }, icon: { color: 'inlineEngagementLabel', marginRight: 4, @@ -205,6 +241,12 @@ borderRadius: 8, marginTop: inlineEngagementStyle.marginTop, }, + reactionsContainerMarginLeft: { + marginLeft: 4, + }, + reactionsContainerMarginRight: { + marginRight: 4, + }, reaction: { color: 'inlineEngagementLabel', fontSize: 14,