From d6abb6e0f51ec7b29117bd9ad5abff493db6d733 Mon Sep 17 00:00:00 2001 From: abzokhattab Date: Thu, 12 Dec 2024 01:13:13 +0200 Subject: [PATCH] Show tags only if the chat is policy expense chat --- .../MoneyRequestPreviewContent.tsx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/components/ReportActionItem/MoneyRequestPreview/MoneyRequestPreviewContent.tsx b/src/components/ReportActionItem/MoneyRequestPreview/MoneyRequestPreviewContent.tsx index 44e3b7488ba3..72e0a43ed5e5 100644 --- a/src/components/ReportActionItem/MoneyRequestPreview/MoneyRequestPreviewContent.tsx +++ b/src/components/ReportActionItem/MoneyRequestPreview/MoneyRequestPreviewContent.tsx @@ -147,7 +147,8 @@ function MoneyRequestPreviewContent({ // When there are no settled transactions in duplicates, show the "Keep this one" button const shouldShowKeepButton = !!(allDuplicates.length && duplicates.length && allDuplicates.length === duplicates.length); - const shouldShowCategoryOrTag = !!tag || !!category; + const shouldShowTag = !!tag && isPolicyExpenseChat; + const shouldShowCategoryOrTag = shouldShowTag || !!category; const shouldShowRBR = hasNoticeTypeViolations || hasWarningTypeViolations || hasViolations || hasFieldErrors || (!isFullySettled && !isFullyApproved && isOnHold); const showCashOrCard = isCardTransaction ? translate('iou.card') : translate('iou.cash'); // We don't use isOnHold because it's true for duplicated transaction too and we only want to show hold message if the transaction is truly on hold @@ -439,7 +440,16 @@ function MoneyRequestPreviewContent({ {shouldShowCategoryOrTag && ( {!!category && ( - + )} - {!!tag && ( + {shouldShowTag && (