@ -4,7 +4,16 @@ import { PRIMARY, SECONDARY, ETH } from '../../../helpers/constants/common'
import CurrencyDisplay from '../../ui/currency-display'
import CurrencyDisplay from '../../ui/currency-display'
import { useUserPreferencedCurrency } from '../../../hooks/useUserPreferencedCurrency'
import { useUserPreferencedCurrency } from '../../../hooks/useUserPreferencedCurrency'
export default function UserPreferencedCurrencyDisplay ( { type , showEthLogo , ethLogoHeight = 12 , ethNumberOfDecimals , fiatNumberOfDecimals , numberOfDecimals : propsNumberOfDecimals , ... restProps } ) {
export default function UserPreferencedCurrencyDisplay ( {
'data-testid' : dataTestId ,
ethLogoHeight = 12 ,
ethNumberOfDecimals ,
fiatNumberOfDecimals ,
numberOfDecimals : propsNumberOfDecimals ,
showEthLogo ,
type ,
... restProps
} ) {
const { currency , numberOfDecimals } = useUserPreferencedCurrency ( type , { ethNumberOfDecimals , fiatNumberOfDecimals , numberOfDecimals : propsNumberOfDecimals } )
const { currency , numberOfDecimals } = useUserPreferencedCurrency ( type , { ethNumberOfDecimals , fiatNumberOfDecimals , numberOfDecimals : propsNumberOfDecimals } )
const prefixComponent = useMemo ( ( ) => {
const prefixComponent = useMemo ( ( ) => {
@ -20,6 +29,7 @@ export default function UserPreferencedCurrencyDisplay ({ type, showEthLogo, eth
< CurrencyDisplay
< CurrencyDisplay
{ ... restProps }
{ ... restProps }
currency = { currency }
currency = { currency }
data - testid = { dataTestId }
numberOfDecimals = { numberOfDecimals }
numberOfDecimals = { numberOfDecimals }
prefixComponent = { prefixComponent }
prefixComponent = { prefixComponent }
/ >
/ >
@ -28,6 +38,7 @@ export default function UserPreferencedCurrencyDisplay ({ type, showEthLogo, eth
UserPreferencedCurrencyDisplay . propTypes = {
UserPreferencedCurrencyDisplay . propTypes = {
className : PropTypes . string ,
className : PropTypes . string ,
'data-testid' : PropTypes . string ,
prefix : PropTypes . string ,
prefix : PropTypes . string ,
value : PropTypes . string ,
value : PropTypes . string ,
numberOfDecimals : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . number ] ) ,
numberOfDecimals : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . number ] ) ,