From 89961ed6b93ad4f5b4979222bc4cb886a9d56172 Mon Sep 17 00:00:00 2001 From: ginsuma <13113013+ginsuma@users.noreply.github.com> Date: Wed, 23 Aug 2023 16:32:32 +0700 Subject: [PATCH 1/2] Fix different grayness levels on parent and child message --- src/components/OfflineWithFeedback.js | 6 +++++- src/pages/home/report/ReportActionItemParentAction.js | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/OfflineWithFeedback.js b/src/components/OfflineWithFeedback.js index 2f99b21b6523..fb0411d24f4c 100644 --- a/src/components/OfflineWithFeedback.js +++ b/src/components/OfflineWithFeedback.js @@ -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, @@ -63,6 +66,7 @@ const defaultProps = { shouldHideOnDelete: true, errors: null, shouldShowErrorMessages: true, + shouldDisableOpacity: false, onClose: () => {}, style: [], contentContainerStyle: [], @@ -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; diff --git a/src/pages/home/report/ReportActionItemParentAction.js b/src/pages/home/report/ReportActionItemParentAction.js index 2af66779309e..c8c36714de44 100644 --- a/src/pages/home/report/ReportActionItemParentAction.js +++ b/src/pages/home/report/ReportActionItemParentAction.js @@ -53,6 +53,7 @@ function ReportActionItemParentAction(props) { } return ( Date: Wed, 23 Aug 2023 23:09:01 +0700 Subject: [PATCH 2/2] Remove prop type warning --- src/pages/home/report/ReportActionItemParentAction.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionItemParentAction.js b/src/pages/home/report/ReportActionItemParentAction.js index c8c36714de44..1d89d76e960f 100644 --- a/src/pages/home/report/ReportActionItemParentAction.js +++ b/src/pages/home/report/ReportActionItemParentAction.js @@ -53,7 +53,7 @@ function ReportActionItemParentAction(props) { } return (