Skip to content

Commit

Permalink
Merge pull request #52529 from nkdengineer/fix/52370
Browse files Browse the repository at this point in the history
Fix workspace card list style
  • Loading branch information
mountiny authored Nov 15, 2024
2 parents 9228354 + ae29f3a commit 09f6db7
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 17 deletions.
14 changes: 11 additions & 3 deletions src/pages/workspace/expensifyCard/WorkspaceCardListHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ function WorkspaceCardListHeader({policyID}: WorkspaceCardListHeaderProps) {
/>
</View>

<View style={[styles.flexRow, styles.mh5, styles.gap5, styles.p4]}>
<View style={[styles.flexRow, styles.flex5, styles.gap2, styles.alignItemsCenter]}>
<View style={[styles.flexRow, styles.mh5, styles.gap2, styles.p4]}>
<View style={[styles.flexRow, styles.flex4, styles.gap2, styles.alignItemsCenter]}>
<Text
numberOfLines={1}
style={[styles.textLabelSupporting, styles.lh16]}
Expand All @@ -64,7 +64,15 @@ function WorkspaceCardListHeader({policyID}: WorkspaceCardListHeaderProps) {
</Text>
</View>
)}
<View style={[styles.flexRow, styles.gap2, shouldUseNarrowLayout ? styles.flex2 : styles.flex1, styles.alignItemsCenter, styles.justifyContentStart]}>
<View
style={[
styles.flexRow,
styles.gap2,
shouldUseNarrowLayout ? styles.flex2 : styles.flex1,
styles.alignItemsCenter,
shouldUseNarrowLayout ? styles.justifyContentCenter : styles.justifyContentStart,
]}
>
<Text
numberOfLines={1}
style={[styles.textLabelSupporting, styles.lh16]}
Expand Down
34 changes: 20 additions & 14 deletions src/pages/workspace/expensifyCard/WorkspaceCardListRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ function WorkspaceCardListRow({limit, cardholder, lastFourPAN, name, currency, i
const cardholderName = useMemo(() => PersonalDetailsUtils.getDisplayNameOrDefault(cardholder), [cardholder]);
const cardType = isVirtual ? translate('workspace.expensifyCard.virtual') : translate('workspace.expensifyCard.physical');
return (
<View style={[styles.flexRow, styles.gap5, styles.br3, styles.p4]}>
<View style={[styles.flexRow, styles.flex5, styles.gap3, styles.alignItemsCenter]}>
<View style={[styles.flexRow, styles.gap3, styles.br3, styles.p4]}>
<View style={[styles.flexRow, styles.flex4, styles.gap3, styles.alignItemsCenter]}>
<Avatar
source={cardholder?.avatar ?? FallbackAvatar}
avatarID={cardholder?.accountID}
Expand All @@ -66,13 +66,21 @@ function WorkspaceCardListRow({limit, cardholder, lastFourPAN, name, currency, i
<View style={[styles.flexRow, styles.gap2, styles.flex1, styles.alignItemsCenter, styles.justifyContentStart]}>
<Text
numberOfLines={1}
style={[styles.textNormalThemeText]}
style={[styles.textNormalThemeText, styles.lh16]}
>
{cardType}
</Text>
</View>
)}
<View style={[styles.flexRow, styles.gap2, shouldUseNarrowLayout ? styles.flex2 : styles.flex1, styles.alignItemsCenter, styles.justifyContentStart]}>
<View
style={[
styles.flexRow,
styles.gap2,
shouldUseNarrowLayout ? styles.flex2 : styles.flex1,
shouldUseNarrowLayout ? styles.alignItemsStart : styles.alignItemsCenter,
shouldUseNarrowLayout ? styles.justifyContentCenter : styles.justifyContentStart,
]}
>
<Text
numberOfLines={1}
style={[styles.textNormalThemeText]}
Expand All @@ -86,24 +94,22 @@ function WorkspaceCardListRow({limit, cardholder, lastFourPAN, name, currency, i
shouldUseNarrowLayout ? styles.flex3 : styles.flex1,
!shouldUseNarrowLayout && styles.gap2,
!shouldUseNarrowLayout ? styles.alignItemsCenter : styles.alignItemsEnd,
styles.justifyContentEnd,
shouldUseNarrowLayout ? styles.justifyContentStart : styles.justifyContentEnd,
]}
>
<Text
numberOfLines={1}
style={[styles.textNormalThemeText]}
>
{CurrencyUtils.convertToDisplayString(limit, currency)}
{CurrencyUtils.convertToShortDisplayString(limit, currency)}
</Text>
{shouldUseNarrowLayout && (
<View style={[styles.flexRow, styles.gap2, styles.flex1, styles.alignItemsCenter, styles.justifyContentStart]}>
<Text
numberOfLines={1}
style={[styles.textLabelSupporting]}
>
{cardType}
</Text>
</View>
<Text
numberOfLines={1}
style={[styles.textLabelSupporting, styles.lh16]}
>
{cardType}
</Text>
)}
</View>
</View>
Expand Down

0 comments on commit 09f6db7

Please sign in to comment.