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

Fix different grayness levels on parent and child messages. #25675

Merged
merged 2 commits into from
Aug 24, 2023
Merged
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
6 changes: 5 additions & 1 deletion src/components/OfflineWithFeedback.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ const propTypes = {
/** Whether we should show the error messages */
shouldShowErrorMessages: PropTypes.bool,

/** Whether we should disable opacity */
shouldDisableOpacity: PropTypes.bool,

/** A function to run when the X button next to the error is clicked */
onClose: PropTypes.func,

Expand All @@ -63,6 +66,7 @@ const defaultProps = {
shouldHideOnDelete: true,
errors: null,
shouldShowErrorMessages: true,
shouldDisableOpacity: false,
onClose: () => {},
style: [],
contentContainerStyle: [],
Expand Down Expand Up @@ -96,7 +100,7 @@ function OfflineWithFeedback(props) {
const isOfflinePendingAction = props.network.isOffline && props.pendingAction;
const isUpdateOrDeleteError = hasErrors && (props.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE || props.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE);
const isAddError = hasErrors && props.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD;
const needsOpacity = (isOfflinePendingAction && !isUpdateOrDeleteError) || isAddError;
const needsOpacity = !props.shouldDisableOpacity && ((isOfflinePendingAction && !isUpdateOrDeleteError) || isAddError);
const needsStrikeThrough = props.network.isOffline && props.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE;
const hideChildren = props.shouldHideOnDelete && !props.network.isOffline && props.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE && !hasErrors;
let children = props.children;
Expand Down
1 change: 1 addition & 0 deletions src/pages/home/report/ReportActionItemParentAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ function ReportActionItemParentAction(props) {
}
return (
<OfflineWithFeedback
shouldDisableOpacity={Boolean(parentReportAction.pendingAction)}
pendingAction={lodashGet(props.report, 'pendingFields.addWorkspaceRoom') || lodashGet(props.report, 'pendingFields.createChat')}
errors={lodashGet(props.report, 'errorFields.addWorkspaceRoom') || lodashGet(props.report, 'errorFields.createChat')}
errorRowStyles={[styles.ml10, styles.mr2]}
Expand Down
Loading