Skip to content
Merged
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
34 changes: 22 additions & 12 deletions src/pages/workspace/companyCards/WorkspaceCompanyCardsTableItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@

const lastCardNumbers = isPlaidCardFeed ? lastFourNumbersFromCardName(cardName) : splitMaskedCardNumber(cardName)?.lastDigits;

const alternateLoginText = shouldUseNarrowTableRowLayout ? `${customCardName}${lastCardNumbers ? ` - ${lastCardNumbers}` : ''}` : (cardholder?.login ?? '');
const alternateLoginText = shouldUseNarrowTableRowLayout ? `${customCardName ?? ''}${lastCardNumbers ? ` - ${lastCardNumbers}` : ''}` : (cardholder?.login ?? '');

const resetFailedCompanyCardAssignment = () => {
if (!failedCompanyCardAssignment) {
Expand Down Expand Up @@ -213,12 +213,16 @@
/>
)}

<Text
numberOfLines={1}
style={[styles.optionDisplayName, styles.textStrong, styles.pre]}
>
{translate('workspace.moreFeatures.companyCards.unassignedCards')}
</Text>
<View style={[styles.flex1, styles.flexColumn, styles.justifyContentCenter, styles.alignItemsStretch]}>
<TextWithTooltip
text={translate('workspace.moreFeatures.companyCards.unassignedCards')}
style={[styles.optionDisplayName, styles.sidebarLinkTextBold, styles.pre, styles.justifyContentCenter]}
/>
<TextWithTooltip
text={cardName}
style={[styles.textLabelSupporting, styles.lh16, styles.pre, styles.mr3]}
/>
</View>
</>
)}
</View>
Expand Down Expand Up @@ -254,14 +258,20 @@
/>
</View>
)}
{!isAssigned && (
<Button
{!isAssigned && shouldUseNarrowTableRowLayout && (<Button

Check failure on line 261 in src/pages/workspace/companyCards/WorkspaceCompanyCardsTableItem.tsx

View workflow job for this annotation

GitHub Actions / ESLint check

The left side of conditional rendering should be a boolean, not "boolean | undefined"

Check failure on line 261 in src/pages/workspace/companyCards/WorkspaceCompanyCardsTableItem.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

The left side of conditional rendering should be a boolean, not "boolean | undefined"
success
text={shouldUseNarrowTableRowLayout ? translate('workspace.companyCards.assign') : translate('workspace.companyCards.assignCard')}
small
text={translate('workspace.companyCards.assign')}
onPress={assignCard}
isDisabled={isAssigningCardDisabled}
/>
)}
/>)}

{!isAssigned && !shouldUseNarrowTableRowLayout && (<Button
success
text={translate('workspace.companyCards.assignCard')}
onPress={assignCard}
isDisabled={isAssigningCardDisabled}
/>)}
</View>
</View>
)}
Expand Down
Loading