-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add ReportActionItemThread
and Thread Replies UI
#18274
Merged
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
982c97b
Add new button for replying in threads
stitesExpensify e09ee8b
Add size prop
stitesExpensify 1d40aa0
Add imageSize method
stitesExpensify 4b919fd
change all sizes based on prop
stitesExpensify 55aa13b
Add threads component
stitesExpensify 8162704
Create new component to display threads in reportActions
stitesExpensify e7b3b9f
Add method for creating/opening threads
stitesExpensify 4db53da
Pass the child reportactionID through the context menu
stitesExpensify 8b31d03
Update API call to properly create optimistic thread report and repor…
stitesExpensify 7761696
go back instead of always home
stitesExpensify bae93b4
Remove changes to navigation
stitesExpensify 3b73583
Remove new openChildReport method
stitesExpensify 10fe957
Extract more code to other PRs
stitesExpensify 7780871
Merge branch 'main' into stites-threadUI
grgia a05a95a
Clean up thread styles, use Multiple Avatars
grgia 0de7775
Undo changes to RoomHeaderAvatars that are already accomplished by Mu…
grgia 9afd2f2
Add translations
grgia c75840a
Temporarily reference reportAction
grgia cd52ecc
Clean up, icon helper function
grgia b54a6b0
Allow to be pressed
grgia 0f336e4
Merge branch 'main' into stites-threadUI
grgia 00c1532
fix delimiter
grgia 20bc93d
undo, my testing data was wrong
grgia 35492e2
Clean up
grgia f69af26
Remove unused param docs
grgia 1168c38
Merge branch 'main' of github.com:Expensify/App into stites-threadUI
stitesExpensify 3104e3e
Add beta check
stitesExpensify f97c600
Add betas to proptypes
stitesExpensify 779fa63
Rename to getIconsForParticipants and fix param type
grgia 628de21
Merge branch 'main' into stites-threadUI
grgia 087862e
Make text not selectable
grgia 67d6171
Merge branch 'main' into stites-threadUI
grgia 30f5eba
Don't show on thread preview (first chat in thread)
grgia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import React from 'react'; | ||
import {View, Pressable, Text} from 'react-native'; | ||
import PropTypes from 'prop-types'; | ||
import _ from 'underscore'; | ||
import styles from '../../../styles/styles'; | ||
import * as Report from '../../../libs/actions/Report'; | ||
import withLocalize, {withLocalizePropTypes} from '../../../components/withLocalize'; | ||
import CONST from '../../../CONST'; | ||
import avatarPropTypes from '../../../components/avatarPropTypes'; | ||
import MultipleAvatars from '../../../components/MultipleAvatars'; | ||
import Navigation from '../../../libs/Navigation/Navigation'; | ||
import ROUTES from '../../../ROUTES'; | ||
|
||
const propTypes = { | ||
/** List of participant icons for the thread */ | ||
icons: PropTypes.arrayOf(avatarPropTypes).isRequired, | ||
|
||
/** Number of comments under the thread */ | ||
numberOfReplies: PropTypes.number.isRequired, | ||
|
||
/** Time of the most recent reply */ | ||
mostRecentReply: PropTypes.string.isRequired, | ||
|
||
/** ID of child thread report */ | ||
childReportID: PropTypes.string.isRequired, | ||
|
||
/** localization props */ | ||
...withLocalizePropTypes, | ||
}; | ||
|
||
const ReportActionItemThread = (props) => ( | ||
<View style={[styles.chatItemMessage]}> | ||
<Pressable | ||
grgia marked this conversation as resolved.
Show resolved
Hide resolved
|
||
onPress={() => { | ||
Report.openReport(props.childReportID); | ||
Navigation.navigate(ROUTES.getReportRoute(props.childReportID)); | ||
}} | ||
> | ||
<View style={[styles.flexRow, styles.alignItemsCenter, styles.mt2]}> | ||
grgia marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<MultipleAvatars | ||
grgia marked this conversation as resolved.
Show resolved
Hide resolved
|
||
size={CONST.AVATAR_SIZE.SMALLER} | ||
icons={props.icons} | ||
shouldStackHorizontally | ||
grgia marked this conversation as resolved.
Show resolved
Hide resolved
|
||
avatarTooltips={_.map(props.icons, (icon) => icon.name)} | ||
/> | ||
<View style={[styles.flexRow, styles.lh140Percent, styles.alignItemsEnd]}> | ||
grgia marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<Text | ||
selectable={false} | ||
style={[styles.link, styles.ml2, styles.h4]} | ||
> | ||
{`${props.numberOfReplies} ${props.numberOfReplies === 1 ? props.translate('threads.reply') : props.translate('threads.replies')}`} | ||
</Text> | ||
<Text | ||
selectable={false} | ||
style={[styles.ml2, styles.textMicroSupporting]} | ||
>{`${props.translate('threads.lastReply')} ${props.datetimeToCalendarTime(props.mostRecentReply)}`}</Text> | ||
</View> | ||
</View> | ||
</Pressable> | ||
</View> | ||
); | ||
|
||
ReportActionItemThread.propTypes = propTypes; | ||
ReportActionItemThread.displayName = 'ReportActionItemThread'; | ||
|
||
export default withLocalize(ReportActionItemThread); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋This has caused a small visual issue in #19398.
Reply
text wasn't aligned with composer when editing, ReportActionItemThread should have the same styles applied as ReportActionItemReactions above:this.props.draftMessage ? styles.chatItemReactionsDraftRight : {}