Skip to content

Commit d6ad1ab

Browse files
committed
fix: quote card icons that read chainId
1 parent 86d614f commit d6ad1ab

File tree

1 file changed

+21
-22
lines changed

1 file changed

+21
-22
lines changed

ui/pages/bridge/quotes/bridge-quote-card.tsx

+21-22
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ import {
4545
BRIDGE_MM_FEE_RATE,
4646
NETWORK_TO_SHORT_NETWORK_NAME_MAP,
4747
} from '../../../../shared/constants/bridge';
48-
import { decimalToPrefixedHex } from '../../../../shared/modules/conversion.utils';
4948
import { TERMS_OF_USE_LINK } from '../../../../shared/constants/terms';
5049
import { getIntlLocale } from '../../../ducks/locale/locale';
5150
import { getImageForChainId } from '../../../selectors/multichain';
@@ -97,7 +96,7 @@ export const BridgeQuoteCard = () => {
9796
</Row>
9897
<Column height={BlockSize.Full} alignItems={AlignItems.flexEnd}>
9998
<Text
100-
as={'a'}
99+
as="a"
101100
variant={TextVariant.bodyMd}
102101
color={TextColor.primaryDefault}
103102
onClick={() => {
@@ -130,38 +129,38 @@ export const BridgeQuoteCard = () => {
130129
<Row gap={1}>
131130
<AvatarNetwork
132131
name={fromChain?.name ?? ''}
133-
src={getImageForChainId(
134-
decimalToPrefixedHex(activeQuote.quote.srcChainId),
135-
)}
132+
src={
133+
fromChain?.chainId
134+
? getImageForChainId(fromChain.chainId)
135+
: undefined
136+
}
136137
size={AvatarNetworkSize.Xs}
137138
backgroundColor={BackgroundColor.transparent}
138139
/>
139140
<Text style={{ whiteSpace: 'nowrap' }}>
140-
{
141-
NETWORK_TO_SHORT_NETWORK_NAME_MAP[
142-
decimalToPrefixedHex(
143-
activeQuote.quote.srcChainId,
144-
) as keyof typeof NETWORK_TO_SHORT_NETWORK_NAME_MAP
145-
]
146-
}
141+
{fromChain?.chainId
142+
? NETWORK_TO_SHORT_NETWORK_NAME_MAP[
143+
fromChain.chainId as keyof typeof NETWORK_TO_SHORT_NETWORK_NAME_MAP
144+
]
145+
: fromChain?.name}
147146
</Text>
148147
<Icon name={IconName.Arrow2Right} size={IconSize.Xs} />
149148
<AvatarNetwork
150149
name={toChain?.name ?? ''}
151-
src={getImageForChainId(
152-
decimalToPrefixedHex(activeQuote.quote.destChainId),
153-
)}
150+
src={
151+
toChain?.chainId
152+
? getImageForChainId(toChain.chainId)
153+
: undefined
154+
}
154155
size={AvatarNetworkSize.Xs}
155156
backgroundColor={BackgroundColor.transparent}
156157
/>
157158
<Text style={{ whiteSpace: 'nowrap' }}>
158-
{
159-
NETWORK_TO_SHORT_NETWORK_NAME_MAP[
160-
decimalToPrefixedHex(
161-
activeQuote.quote.destChainId,
162-
) as keyof typeof NETWORK_TO_SHORT_NETWORK_NAME_MAP
163-
]
164-
}
159+
{toChain?.chainId
160+
? NETWORK_TO_SHORT_NETWORK_NAME_MAP[
161+
toChain.chainId as keyof typeof NETWORK_TO_SHORT_NETWORK_NAME_MAP
162+
]
163+
: toChain?.name}
165164
</Text>
166165
</Row>
167166
</Row>

0 commit comments

Comments
 (0)