@ -3,6 +3,7 @@ import { getKnownMethodData } from '../selectors/selectors'
import { getTransactionActionKey , getStatusKey } from '../helpers/utils/transactions.util'
import { getTransactionActionKey , getStatusKey } from '../helpers/utils/transactions.util'
import { camelCaseToCapitalize } from '../helpers/utils/common.util'
import { camelCaseToCapitalize } from '../helpers/utils/common.util'
import { useI18nContext } from './useI18nContext'
import { useI18nContext } from './useI18nContext'
import { useTokenFiatAmount } from './useTokenFiatAmount'
import { PRIMARY , SECONDARY } from '../helpers/constants/common'
import { PRIMARY , SECONDARY } from '../helpers/constants/common'
import { getTokenToAddress } from '../helpers/utils/token-util'
import { getTokenToAddress } from '../helpers/utils/token-util'
import { useUserPreferencedCurrency } from './useUserPreferencedCurrency'
import { useUserPreferencedCurrency } from './useUserPreferencedCurrency'
@ -84,6 +85,7 @@ export function useTransactionDisplayData (transactionGroup) {
const token = isTokenCategory && knownTokens . find ( ( token ) => token . address === recipientAddress )
const token = isTokenCategory && knownTokens . find ( ( token ) => token . address === recipientAddress )
const tokenData = useTokenData ( initialTransaction ? . txParams ? . data , isTokenCategory )
const tokenData = useTokenData ( initialTransaction ? . txParams ? . data , isTokenCategory )
const tokenDisplayValue = useTokenDisplayValue ( initialTransaction ? . txParams ? . data , token , isTokenCategory )
const tokenDisplayValue = useTokenDisplayValue ( initialTransaction ? . txParams ? . data , token , isTokenCategory )
const tokenFiatAmount = useTokenFiatAmount ( token ? . address , tokenDisplayValue , token ? . symbol )
let category
let category
let title
let title
@ -127,14 +129,15 @@ export function useTransactionDisplayData (transactionGroup) {
const [ primaryCurrency ] = useCurrencyDisplay ( primaryValue , {
const [ primaryCurrency ] = useCurrencyDisplay ( primaryValue , {
prefix ,
prefix ,
displayValue : isTokenCategory && tokenDisplayValue ,
displayValue : isTokenCategory ? tokenDisplayValue : undefined ,
suffix : isTokenCategory && token ? . symbol ,
suffix : isTokenCategory ? token ? . symbol : undefined ,
... primaryCurrencyPreferences ,
... primaryCurrencyPreferences ,
} )
} )
const [ secondaryCurrency ] = useCurrencyDisplay ( primaryValue , {
const [ secondaryCurrency ] = useCurrencyDisplay ( primaryValue , {
prefix ,
prefix ,
displayValue : isTokenCategory && tokenDisplayValue ,
displayValue : isTokenCategory ? tokenFiatAmount : undefined ,
hideLabel : isTokenCategory ? true : undefined ,
... secondaryCurrencyPreferences ,
... secondaryCurrencyPreferences ,
} )
} )
@ -146,7 +149,7 @@ export function useTransactionDisplayData (transactionGroup) {
primaryCurrency ,
primaryCurrency ,
senderAddress ,
senderAddress ,
recipientAddress ,
recipientAddress ,
secondaryCurrency : isTokenCategory ? undefined : secondaryCurrency ,
secondaryCurrency : isTokenCategory && ! tokenFiatAmount ? undefined : secondaryCurrency ,
status ,
status ,
isPending : status in PENDING _STATUS _HASH ,
isPending : status in PENDING _STATUS _HASH ,
}
}