From 86f75a5a9b0e4487ba01a8da95e545a6758c8d26 Mon Sep 17 00:00:00 2001
From: Hayata Suenaga <hayata@expensify.com>
Date: Mon, 13 May 2024 12:07:03 -0700
Subject: [PATCH 1/2] fix: navigation and selection display

---
 .../export/QuickbooksCompanyCardExpenseAccountPage.tsx | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx
index b3fd41d9a342..ec5458476847 100644
--- a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx
+++ b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx
@@ -78,9 +78,15 @@ function QuickbooksCompanyCardExpenseAccountPage({policy}: WithPolicyConnections
                     )}
                     <OfflineWithFeedback pendingAction={pendingFields?.nonReimbursableBillDefaultVendor}>
                         <MenuItemWithTopDescription
-                            title={nonReimbursableBillDefaultVendorObject?.name}
+                            title={isVendorSelected ? nonReimbursableBillDefaultVendorObject?.name : nonReimbursableExpensesAccount?.name}
                             description={isVendorSelected ? translate('workspace.qbo.vendor') : translate('workspace.qbo.account')}
-                            onPress={() => Navigation.navigate(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_NON_REIMBURSABLE_DEFAULT_VENDOR_SELECT.getRoute(policyID))}
+                            onPress={() =>
+                                Navigation.navigate(
+                                    isVendorSelected
+                                        ? ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_NON_REIMBURSABLE_DEFAULT_VENDOR_SELECT.getRoute(policyID)
+                                        : ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_COMPANY_CARD_EXPENSE_ACCOUNT_SELECT.getRoute(policyID),
+                                )
+                            }
                             brickRoadIndicator={errorFields?.nonReimbursableBillDefaultVendor ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined}
                             shouldShowRightIcon
                             error={errorFields?.nonReimbursableBillDefaultVendor ? translate('common.genericErrorMessage') : undefined}

From 27b8e9cd54614024370236afd07f2c07e01a8211 Mon Sep 17 00:00:00 2001
From: Hayata Suenaga <hayata@expensify.com>
Date: Mon, 13 May 2024 15:15:45 -0700
Subject: [PATCH 2/2] fix: separate components & error and RBR indicator fields

---
 ...uickbooksCompanyCardExpenseAccountPage.tsx | 33 +++++++++++--------
 1 file changed, 19 insertions(+), 14 deletions(-)

diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx
index ec5458476847..6214c03f4d40 100644
--- a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx
+++ b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx
@@ -77,20 +77,25 @@ function QuickbooksCompanyCardExpenseAccountPage({policy}: WithPolicyConnections
                         </>
                     )}
                     <OfflineWithFeedback pendingAction={pendingFields?.nonReimbursableBillDefaultVendor}>
-                        <MenuItemWithTopDescription
-                            title={isVendorSelected ? nonReimbursableBillDefaultVendorObject?.name : nonReimbursableExpensesAccount?.name}
-                            description={isVendorSelected ? translate('workspace.qbo.vendor') : translate('workspace.qbo.account')}
-                            onPress={() =>
-                                Navigation.navigate(
-                                    isVendorSelected
-                                        ? ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_NON_REIMBURSABLE_DEFAULT_VENDOR_SELECT.getRoute(policyID)
-                                        : ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_COMPANY_CARD_EXPENSE_ACCOUNT_SELECT.getRoute(policyID),
-                                )
-                            }
-                            brickRoadIndicator={errorFields?.nonReimbursableBillDefaultVendor ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined}
-                            shouldShowRightIcon
-                            error={errorFields?.nonReimbursableBillDefaultVendor ? translate('common.genericErrorMessage') : undefined}
-                        />
+                        {isVendorSelected ? (
+                            <MenuItemWithTopDescription
+                                title={nonReimbursableBillDefaultVendorObject?.name}
+                                description={translate('workspace.qbo.vendor')}
+                                onPress={() => Navigation.navigate(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_NON_REIMBURSABLE_DEFAULT_VENDOR_SELECT.getRoute(policyID))}
+                                brickRoadIndicator={errorFields?.nonReimbursableBillDefaultVendor ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined}
+                                shouldShowRightIcon
+                                error={errorFields?.nonReimbursableBillDefaultVendor ? translate('common.genericErrorMessage') : undefined}
+                            />
+                        ) : (
+                            <MenuItemWithTopDescription
+                                title={nonReimbursableExpensesAccount?.name}
+                                description={translate('workspace.qbo.account')}
+                                onPress={() => Navigation.navigate(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_COMPANY_CARD_EXPENSE_ACCOUNT_SELECT.getRoute(policyID))}
+                                brickRoadIndicator={errorFields?.nonReimbursableExpensesAccount ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined}
+                                shouldShowRightIcon
+                                error={errorFields?.nonReimbursableExpensesAccount ? translate('common.genericErrorMessage') : undefined}
+                            />
+                        )}
                     </OfflineWithFeedback>
                 </ScrollView>
             </ScreenWrapper>
