Skip to content

Commit

Permalink
Show tags only if the chat is policy expense chat
Browse files Browse the repository at this point in the history
  • Loading branch information
abzokhattab committed Dec 11, 2024
1 parent 9fe5511 commit d6abb6e
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -439,7 +440,16 @@ function MoneyRequestPreviewContent({
{shouldShowCategoryOrTag && (
<View style={[styles.flexRow, styles.pt1, styles.alignItemsCenter]}>
{!!category && (
<View style={[styles.flexRow, styles.alignItemsCenter, styles.gap1, tag && styles.mw50, tag && styles.pr1, styles.flexShrink1]}>
<View
style={[
styles.flexRow,
styles.alignItemsCenter,
styles.gap1,
shouldShowTag && styles.mw50,
shouldShowTag && styles.pr1,
styles.flexShrink1,
]}
>
<Icon
src={Expensicons.Folder}
height={variables.iconSizeExtraSmall}
Expand All @@ -454,7 +464,7 @@ function MoneyRequestPreviewContent({
</Text>
</View>
)}
{!!tag && (
{shouldShowTag && (
<View style={[styles.flex1, styles.flexRow, styles.alignItemsCenter, styles.gap1, category && styles.pl1]}>
<Icon
src={Expensicons.Tag}
Expand Down

0 comments on commit d6abb6e

Please sign in to comment.