Skip to content

Commit 012fa5d

Browse files
author
Peter Hellstrand
committed
fix(ffe-account-selector-react): format account number in drodown
1 parent bad74d1 commit 012fa5d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/ffe-account-selector-react/src/account-selector/AccountSelector.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { SearchableDropdown } from '@sb1/ffe-searchable-dropdown-react';
77
import { getAccountsWithCustomAccounts } from './getAccountsWithCustomAccounts';
88
import { searchMatcherIgnoringAccountNumberFormatting } from '../searchMatcherIgnoringAccountNumberFormatting';
99
import { texts } from '../texts';
10+
import { formatAccountNumber as formatAccountNumberFFE } from '@sb1/ffe-formatters';
1011

1112
export interface AccountSelectorProps<T extends Account = Account> {
1213
/**
@@ -126,6 +127,9 @@ export const AccountSelector = <T extends Account = Account>({
126127

127128
const dropdownListAccounts = accounts.map(it => ({
128129
...it,
130+
accountNumber: it.accountNumber.includes(' ')
131+
? it.accountNumber
132+
: formatAccountNumberFFE(it.accountNumber),
129133
balance: OptionBody
130134
? it.balance
131135
: balanceWithCurrency(it.balance, locale, it.currencyCode),

0 commit comments

Comments
 (0)