Skip to content

Commit

Permalink
Merge pull request Expensify#53973 from abzokhattab/show-tags-only-if…
Browse files Browse the repository at this point in the history
…-the-chat-is-policy-expense-chatt

Show tags only if the chat is policy expense chat
  • Loading branch information
cristipaval authored Dec 14, 2024
2 parents 258e2be + d6abb6e commit ff2fc94
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 ff2fc94

Please sign in to comment.