Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix workspace card list style #52529

Merged
merged 7 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading