Skip to content

Commit 8916a6c

Browse files
authored
Merge pull request #4024 from EdgeApp/paul/showTokenNames
Show full token names for XRP
2 parents edb97f6 + 5aba103 commit 8916a6c

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/components/data/row/CurrencyRow.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { EdgeCurrencyWallet, EdgeToken } from 'edge-core-js'
22
import * as React from 'react'
33

4+
import { SPECIAL_CURRENCY_INFO } from '../../../constants/WalletAndCurrencyConstants'
45
import { useWalletBalance } from '../../../hooks/useWalletBalance'
56
import { useWalletName } from '../../../hooks/useWalletName'
67
import { useSelector } from '../../../types/reactRedux'
@@ -36,6 +37,8 @@ interface Props {
3637
const CurrencyRowComponent = (props: Props) => {
3738
const { customAsset, marginRem, showRate = false, token, tokenId } = props
3839
const wallet = customAsset?.wallet ?? props.wallet
40+
const { pluginId } = wallet.currencyInfo
41+
const showTokenNames = SPECIAL_CURRENCY_INFO[pluginId]?.showTokenNames
3942

4043
// Currency code and wallet name for display:
4144
const allTokens = wallet.currencyConfig.allTokens
@@ -56,10 +59,15 @@ const CurrencyRowComponent = (props: Props) => {
5659
const fiatText = showBalance ? <FiatText nativeCryptoAmount={balance} tokenId={displayTokenId} wallet={wallet} /> : null
5760
const icon = <CryptoIcon sizeRem={2} tokenId={displayTokenId} walletId={wallet.id} />
5861

62+
let displayCurrencyCode = currencyCode
63+
if (showTokenNames === true && tokenFromId != null) {
64+
displayCurrencyCode = `${tokenFromId.displayName}`
65+
}
66+
5967
return (
6068
<IconDataRow
6169
icon={icon}
62-
leftText={currencyCode}
70+
leftText={displayCurrencyCode}
6371
leftTextExtended={tickerText}
6472
leftSubtext={name}
6573
rightText={cryptoText}

src/constants/WalletAndCurrencyConstants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ interface SpecialCurrencyInfo {
127127
allowZeroTx?: boolean
128128
hasSegwit?: boolean
129129
isAccountActivationRequired?: boolean
130+
showTokenNames?: boolean
130131
isCustomTokensSupported?: boolean
131132
isUriEncodedStructure?: boolean
132133
needsAccountNameSetup?: boolean
@@ -277,6 +278,7 @@ export const SPECIAL_CURRENCY_INFO: {
277278
},
278279
ripple: {
279280
initWalletName: s.strings.string_first_ripple_wallet_name,
281+
showTokenNames: true,
280282
chainCode: 'XRP',
281283
dummyPublicAddress: 'rfuESo7eHUnvebxgaFjfYxfwXhM2uBPAj3',
282284
uniqueIdentifierInfo: {

0 commit comments

Comments
 (0)