Skip to content

Commit

Permalink
fix(ffe-account-selector-react): format account number in drodown
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Hellstrand committed Nov 28, 2024
1 parent bad74d1 commit 68094fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function AccountDetails({
{account && (
<>
<div className="ffe-account-selector-single__details--left">
{accountFormatter(accountNumber)}
{accountFormatter(accountNumber?.replace(/\s/g, ''))}
</div>
{showBalance && (
<div className="ffe-account-selector-single__details--right">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { SearchableDropdown } from '@sb1/ffe-searchable-dropdown-react';
import { getAccountsWithCustomAccounts } from './getAccountsWithCustomAccounts';
import { searchMatcherIgnoringAccountNumberFormatting } from '../searchMatcherIgnoringAccountNumberFormatting';
import { texts } from '../texts';
import { formatAccountNumber as formatAccountNumberFFE } from '@sb1/ffe-formatters';

export interface AccountSelectorProps<T extends Account = Account> {
/**
Expand Down Expand Up @@ -126,6 +127,9 @@ export const AccountSelector = <T extends Account = Account>({

const dropdownListAccounts = accounts.map(it => ({
...it,
accountNumber: formatAccountNumberFFE(
it.accountNumber.replace(/\s/g, ''),
),
balance: OptionBody
? it.balance
: balanceWithCurrency(it.balance, locale, it.currencyCode),
Expand Down

0 comments on commit 68094fe

Please sign in to comment.