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

test divider line #23055

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 9 additions & 2 deletions src/pages/home/report/ReportActionItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ const propTypes = {

/** Is this the only report action on the report? */
isOnlyReportAction: PropTypes.bool,

shouldHideThreadDividerLine: PropTypes.bool,

};

const defaultProps = {
Expand All @@ -107,6 +110,8 @@ const defaultProps = {
shouldShowSubscriptAvatar: false,
hasOutstandingIOU: false,
isOnlyReportAction: false,
shouldHideThreadDividerLine: false,

};

function ReportActionItem(props) {
Expand Down Expand Up @@ -420,7 +425,7 @@ function ReportActionItem(props) {
return (
<TaskView
report={props.report}
shouldShowHorizontalRule={!props.isOnlyReportAction}
shouldShowHorizontalRule={!props.shouldHideThreadDividerLine}
/>
);
}
Expand Down Expand Up @@ -575,6 +580,8 @@ export default compose(
ReportUtils.isCompletedTaskReport(prevProps.report) === ReportUtils.isCompletedTaskReport(nextProps.report) &&
prevProps.report.managerID === nextProps.report.managerID &&
prevProps.report.managerEmail === nextProps.report.managerEmail &&
prevProps.isOnlyReportAction === nextProps.isOnlyReportAction,
prevProps.isOnlyReportAction === nextProps.isOnlyReportAction &&
prevProps.shouldHideThreadDividerLine === nextProps.shouldHideThreadDividerLine,

),
);
6 changes: 4 additions & 2 deletions src/pages/home/report/ReportActionsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,18 @@ function ReportActionsList(props) {
const shouldDisplayNewMarker = reportAction.reportActionID === newMarkerReportActionID;
const shouldDisplayParentAction = reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.CREATED && ReportUtils.isChatThread(report);
const shouldHideThreadDividerLine =
shouldDisplayParentAction && sortedReportActions.length > 1 && sortedReportActions[sortedReportActions.length - 2].reportActionID === newMarkerReportActionID;
sortedReportActions.length > 1 && sortedReportActions[sortedReportActions.length - 2].reportActionID === newMarkerReportActionID;

return shouldDisplayParentAction ? (
<ReportActionItemParentAction
shouldHideThreadDividerLine={shouldHideThreadDividerLine}
shouldHideThreadDividerLine={shouldDisplayParentAction && shouldHideThreadDividerLine}
reportID={report.reportID}
parentReportID={`${report.parentReportID}`}
shouldDisplayNewMarker={shouldDisplayNewMarker}
/>
) : (
<ReportActionItem
shouldHideThreadDividerLine={shouldHideThreadDividerLine}
report={report}
action={reportAction}
displayAsGroup={ReportActionsUtils.isConsecutiveActionMadeByPreviousActor(sortedReportActions, index)}
Expand Down
Loading