Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

20606 - migrated ReportActionItemThread to PressableWithoutFeedback #20660

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/pages/home/report/ReportActionItemThread.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import {View, Pressable, Text} from 'react-native';
import {View, Text} from 'react-native';
import PropTypes from 'prop-types';
import styles from '../../../styles/styles';
import * as Report from '../../../libs/actions/Report';
Expand All @@ -9,6 +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';

const propTypes = {
/** List of participant icons for the thread */
Expand Down Expand Up @@ -38,10 +39,12 @@ const ReportActionItemThread = (props) => {

return (
<View style={[styles.chatItemMessage]}>
<Pressable
<PressableWithoutFeedback
onPress={() => {
Report.navigateToAndOpenChildReport(props.childReportID);
}}
accessibilityRole="button"
accessibilityLabel={`${numberOfRepliesText} ${replyText}`}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be improved? it will stop be unique if you will reach props.numberOfReplies > CONST.MAX_THREAD_REPLIES_PREVIEW - numberOfRepliesText will be ${CONST.MAX_THREAD_REPLIES_PREVIEW}+ , and replyText will be the same - which will produce the same key like 99+ Replies

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm but what should I add to make it unique? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even if I will add message text to the accessibilityLabel it still won't be unique for two of the same messages with +99 replies

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can use something like {${props.numberOfReplies} ${replyText}}

>
<View style={[styles.flexRow, styles.alignItemsCenter, styles.mt2]}>
<MultipleAvatars
Expand All @@ -65,7 +68,7 @@ const ReportActionItemThread = (props) => {
>{`${props.translate('threads.lastReply')} ${timeStamp}`}</Text>
</View>
</View>
</Pressable>
</PressableWithoutFeedback>
</View>
);
};
Expand Down