11import { useCallback , useEffect , useMemo , useRef , useState } from 'react' ;
22import { useSelector } from 'react-redux' ;
33import { selectCurrentCurrency } from '../../../../../selectors/currencyRateController' ;
4- import currencySymbols from '../../../../../util/currency-symbols.json' ;
5- import { getCurrencySymbol } from '../../../../../util/number/bigint' ;
64import { MAX_INPUT_LENGTH } from '../../components/TokenInputArea' ;
75import { BridgeToken } from '../../types' ;
86import { formatAmountWithLocaleSeparators } from '../../utils/formatAmountWithLocaleSeparators' ;
@@ -12,20 +10,11 @@ import {
1210 formatSecondaryTokenAmount ,
1311 formatTokenInputAmountFromFiat ,
1412} from '../../utils/sourceAmountInputMode' ;
15- import { formatCurrency } from '../../utils/currencyUtils' ;
13+ import { formatCurrency , getCurrencySymbol } from '../../utils/currencyUtils' ;
1614import { useSourceAmountCursor } from '../useSourceAmountCursor' ;
1715import { useTokenFiatRate } from '../useTokenFiatRate' ;
1816
1917const FIAT_KEYPAD_CURRENCY = 'SWAPS_FIAT_INPUT' ;
20- type CurrencyCode = keyof typeof currencySymbols ;
21-
22- const getInputCurrencySymbol = ( currency ?: string ) => {
23- const currencyCode = ( currency || 'usd' ) . toLowerCase ( ) ;
24-
25- return currencyCode in currencySymbols
26- ? getCurrencySymbol ( currencyCode as CurrencyCode )
27- : currencyCode . toUpperCase ( ) ;
28- } ;
2918
3019export const useSourceAmountInput = ( {
3120 sourceAmount,
@@ -202,7 +191,7 @@ export const useSourceAmountInput = ({
202191 } , [ canToggle , currentCurrency , isFiatMode , sourceAmount , sourceToken ] ) ;
203192
204193 const inputPrefix = isFiatMode
205- ? getInputCurrencySymbol ( currentCurrency )
194+ ? getCurrencySymbol ( currentCurrency || 'usd' )
206195 : undefined ;
207196
208197 return {
0 commit comments