Skip to content

Commit

Permalink
feat(buy): added fallback for places where we do render bank items
Browse files Browse the repository at this point in the history
  • Loading branch information
milan-bc committed Mar 30, 2021
1 parent 2bf55b4 commit 7dbd30c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Expand Up @@ -75,17 +75,16 @@ type BankProps = {

const Bank = ({ bankDetails, icon, isActive, onClick, text }: BankProps) => (
<DisplayContainer
data-e2e={`sb${bankDetails.bankAccountType.toLowerCase()}Banks`}
data-e2e={`sb${bankDetails?.bankAccountType?.toLowerCase()}Banks`}
role='button'
onClick={onClick}
>
<DisplayIcon>{icon}</DisplayIcon>
<MultiRowContainer>
<StyledValue asTitle>{text}</StyledValue>
<StyledTitle asValue>
{`${bankDetails.bankAccountType.toLowerCase()} account ${
bankDetails.accountNumber
}`}
{`${bankDetails?.bankAccountType?.toLowerCase() ||
''} account ${bankDetails?.accountNumber || ''}`}
</StyledTitle>
<CartridgeContainer>
<SuccessCartridge>
Expand Down
Expand Up @@ -29,7 +29,7 @@ type Props = {
value: SBPaymentMethodType
}

const Bank: React.FC<Props> = ({ icon, onClick, text, value }) => (
const Bank = ({ icon, onClick, text, value }: Props) => (
<DisplayContainer
data-e2e={`sb${value.type.toLowerCase()}Banks`}
role='button'
Expand All @@ -39,9 +39,8 @@ const Bank: React.FC<Props> = ({ icon, onClick, text, value }) => (
<MultiRowContainer>
<StyledValue asTitle>{text}</StyledValue>
<StyledTitle asValue>
{`${value.details?.bankAccountType.toLowerCase()} account ${
value.details?.accountNumber
}`}
{`${value.details?.bankAccountType?.toLowerCase() || ''} account ${value
.details?.accountNumber || ''}`}
</StyledTitle>
</MultiRowContainer>
</DisplayContainer>
Expand Down

0 comments on commit 7dbd30c

Please sign in to comment.