Skip to content

Commit

Permalink
Merge pull request #22670 from ShogunFire/fixLongPressOnXReplies
Browse files Browse the repository at this point in the history
  • Loading branch information
thienlnam authored Jul 12, 2023
2 parents e13d54d + 23f9c8d commit aa2995e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/pages/home/report/ReportActionItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ function ReportActionItem(props) {
mostRecentReply={`${props.action.childLastVisibleActionCreated}`}
isHovered={hovered}
icons={ReportUtils.getIconsForParticipants(oldestFourAccountIDs, props.personalDetailsList)}
onSecondaryInteraction={showPopover}
/>
</View>
)}
Expand Down
10 changes: 7 additions & 3 deletions src/pages/home/report/ReportActionItemThread.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import CONST from '../../../CONST';
import avatarPropTypes from '../../../components/avatarPropTypes';
import MultipleAvatars from '../../../components/MultipleAvatars';
import compose from '../../../libs/compose';
import PressableWithoutFeedback from '../../../components/Pressable/PressableWithoutFeedback';
import PressableWithSecondaryInteraction from '../../../components/PressableWithSecondaryInteraction';

const propTypes = {
/** List of participant icons for the thread */
Expand All @@ -27,6 +27,9 @@ const propTypes = {
/** Whether the thread item / message is being hovered */
isHovered: PropTypes.bool.isRequired,

/** The function that should be called when the thread is LongPressed or right-clicked */
onSecondaryInteraction: PropTypes.func.isRequired,

...withLocalizePropTypes,
...windowDimensionsPropTypes,
};
Expand All @@ -39,12 +42,13 @@ function ReportActionItemThread(props) {

return (
<View style={[styles.chatItemMessage]}>
<PressableWithoutFeedback
<PressableWithSecondaryInteraction
onPress={() => {
Report.navigateToAndOpenChildReport(props.childReportID);
}}
accessibilityRole={CONST.ACCESSIBILITY_ROLE.BUTTON}
accessibilityLabel={`${props.numberOfReplies} ${replyText}`}
onSecondaryInteraction={props.onSecondaryInteraction}
>
<View style={[styles.flexRow, styles.alignItemsCenter, styles.mt2]}>
<MultipleAvatars
Expand All @@ -70,7 +74,7 @@ function ReportActionItemThread(props) {
</Text>
</View>
</View>
</PressableWithoutFeedback>
</PressableWithSecondaryInteraction>
</View>
);
}
Expand Down

0 comments on commit aa2995e

Please sign in to comment.