From 00b8267254a24b79a755e5bf4388f0e1da7351f8 Mon Sep 17 00:00:00 2001 From: Christoph Pader Date: Thu, 18 Dec 2025 12:27:00 -0500 Subject: [PATCH 01/15] feat: refactor `OfflineWithFeedback` and error dismissal --- src/components/ErrorMessageRow.tsx | 12 +-- src/components/ImportSpreadsheetColumns.tsx | 1 - src/components/MessagesRow.tsx | 41 ++++++----- src/components/OfflineWithFeedback.tsx | 23 +++--- src/components/SelectionScreen.tsx | 2 +- .../VerifiedBankAccountFlowEntryPoint.tsx | 3 +- .../Contacts/ContactMethodDetailsPage.tsx | 2 +- .../settings/Wallet/PaymentMethodListItem.tsx | 3 +- src/pages/workspace/WorkspaceMembersPage.tsx | 2 +- ...oksOutOfPocketExpenseConfigurationPage.tsx | 1 - .../WorkspaceCompanyCardsTableItem.tsx | 73 ++++++++++--------- .../assignCard/ConfirmationStep.tsx | 1 - src/styles/index.ts | 5 ++ 13 files changed, 84 insertions(+), 85 deletions(-) diff --git a/src/components/ErrorMessageRow.tsx b/src/components/ErrorMessageRow.tsx index 8086fc714f6ed..9d3274aa34ddc 100644 --- a/src/components/ErrorMessageRow.tsx +++ b/src/components/ErrorMessageRow.tsx @@ -16,17 +16,14 @@ type ErrorMessageRowProps = { /** Additional style object for the error row text */ errorRowTextStyles?: StyleProp; - /** A function to run when the X button next to the error is clicked */ - onClose?: () => void; - - /** Whether we can dismiss the error message */ - canDismissError?: boolean; + /** If passed, an X button next to the error will be shown and which triggers this callback */ + onDismiss?: () => void; /** A function to dismiss error */ dismissError?: () => void; }; -function ErrorMessageRow({errors, errorRowStyles, onClose, canDismissError = true, dismissError, errorRowTextStyles}: ErrorMessageRowProps) { +function ErrorMessageRow({errors, errorRowStyles, onDismiss, dismissError, errorRowTextStyles}: ErrorMessageRowProps) { // Some errors have a null message. This is used to apply opacity only and to avoid showing redundant messages. const errorEntries = Object.entries(errors ?? {}); const filteredErrorEntries = errorEntries.filter((errorEntry): errorEntry is [string, string | ReceiptError | OnyxCommon.TranslationKeyError] => errorEntry[1] !== null); @@ -37,10 +34,9 @@ function ErrorMessageRow({errors, errorRowStyles, onClose, canDismissError = tru ) : null; diff --git a/src/components/ImportSpreadsheetColumns.tsx b/src/components/ImportSpreadsheetColumns.tsx index b1d8b93127404..d05c309da9ed6 100644 --- a/src/components/ImportSpreadsheetColumns.tsx +++ b/src/components/ImportSpreadsheetColumns.tsx @@ -108,7 +108,6 @@ function ImportSpreadsheetColumns({ shouldDisplayErrorAbove errors={errors} errorRowStyles={styles.mv2} - canDismissError={false} >