Skip to content

Commit

Permalink
Merge pull request #26213 from ginsuma/fix/24263
Browse files Browse the repository at this point in the history
Fix different grayness levels on parent and child message
  • Loading branch information
techievivek authored Sep 11, 2023
2 parents adac19c + cf41264 commit 1ae51cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
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(lodashGet(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

0 comments on commit 1ae51cc

Please sign in to comment.