Skip to content

Commit

Permalink
Merge pull request #25675 from ginsuma/fix/24263
Browse files Browse the repository at this point in the history
Fix different grayness levels on parent and child messages.
  • Loading branch information
techievivek authored Aug 24, 2023
2 parents 00efce4 + 71ed934 commit eae1224
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(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 eae1224

Please sign in to comment.