-
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
Changes from 17 commits
982c97b
e09ee8b
1d40aa0
4b919fd
55aa13b
8162704
e7b3b9f
4db53da
8b31d03
7761696
bae93b4
3b73583
10fe957
7780871
a05a95a
0de7775
9afd2f2
c75840a
cd52ecc
b54a6b0
0f336e4
00c1532
20bc93d
35492e2
f69af26
1168c38
3104e3e
f97c600
779fa63
628de21
087862e
67d6171
30f5eba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ import ReportActionItemMessage from './ReportActionItemMessage'; | |
import UnreadActionIndicator from '../../../components/UnreadActionIndicator'; | ||
import ReportActionItemMessageEdit from './ReportActionItemMessageEdit'; | ||
import ReportActionItemCreated from './ReportActionItemCreated'; | ||
import ReportActionItemThread from './ReportActionItemThread'; | ||
import compose from '../../../libs/compose'; | ||
import withWindowDimensions, {windowDimensionsPropTypes} from '../../../components/withWindowDimensions'; | ||
import ControlSelection from '../../../libs/ControlSelection'; | ||
|
@@ -163,6 +164,7 @@ class ReportActionItem extends Component { | |
this.checkIfContextMenuActive, | ||
ReportUtils.isArchivedRoom(this.props.report), | ||
ReportUtils.chatIncludesChronos(this.props.report), | ||
this.props.action.childReportID, | ||
grgia marked this conversation as resolved.
Show resolved
Hide resolved
|
||
); | ||
} | ||
|
||
|
@@ -244,6 +246,7 @@ class ReportActionItem extends Component { | |
toggleReaction={this.toggleReaction} | ||
/> | ||
)} | ||
<ReportActionItemThread numberOfReplies={7} mostRecentReply={'1:03pm'} icons={ReportUtils.getIcons(this.props.report, this.props.personalDetails)} /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @chiragsalian how are we handling the conditional rendering of this. Would we just check if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ReportUtils.js isThread? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Discussed 1:1, yes just checking |
||
</> | ||
); | ||
} | ||
|
@@ -354,6 +357,7 @@ class ReportActionItem extends Component { | |
} | ||
draftMessage={this.props.draftMessage} | ||
isChronosReport={ReportUtils.chatIncludesChronos(this.props.report)} | ||
childReportActionID={this.props.action.childReportActionID} | ||
grgia marked this conversation as resolved.
Show resolved
Hide resolved
|
||
/> | ||
</View> | ||
)} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import React from 'react'; | ||
import {View, Pressable, Text} from 'react-native'; | ||
import PropTypes from 'prop-types'; | ||
import _ from 'underscore'; | ||
import lodashGet from 'lodash/get'; | ||
import styles from '../../../styles/styles'; | ||
import ReportActionItemFragment from './ReportActionItemFragment'; | ||
import reportActionPropTypes from './reportActionPropTypes'; | ||
import * as Report from '../../../libs/actions/Report'; | ||
import withLocalize, {withLocalizePropTypes} from '../../../components/withLocalize'; | ||
import CONST from "../../../CONST"; | ||
import avatarPropTypes from "../../../components/avatarPropTypes"; | ||
import themeColors from "../../../styles/themes/default"; | ||
import MultipleAvatars from '../../../components/MultipleAvatars'; | ||
|
||
const propTypes = { | ||
// childReportID: PropTypes.number.isRequired, | ||
|
||
grgia marked this conversation as resolved.
Show resolved
Hide resolved
|
||
icons: PropTypes.arrayOf(avatarPropTypes).isRequired, | ||
|
||
numberOfReplies: PropTypes.number.isRequired, | ||
|
||
mostRecentReply: PropTypes.string.isRequired, | ||
|
||
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.OpenChildReport(props.childReportID) | ||
return ''; | ||
}} | ||
> | ||
<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.lhPercent, styles.alignItemsEnd]}> | ||
<Text style={[styles.link, styles.ml2, styles.h4]}>{`${props.numberOfReplies} ${props.translate('threads.replies')}`}</Text> | ||
<Text style={[styles.ml2, styles.textMicroSupporting]}>{`${props.translate('threads.lastReplyAt')} ${props.mostRecentReply}`}</Text> | ||
</View> | ||
</View> | ||
|
||
</Pressable> | ||
</View> | ||
); | ||
|
||
ReportActionItemThread.propTypes = propTypes; | ||
ReportActionItemThread.displayName = 'ReportActionItemThread'; | ||
|
||
export default withLocalize(ReportActionItemThread); |
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.
looks like we got rid of this param