File tree Expand file tree Collapse file tree 3 files changed +19
-3
lines changed
packages/ui/src/components
common/TokenSelector/triggers Expand file tree Collapse file tree 3 files changed +19
-3
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @reservoir0x/relay-kit-ui ' : patch
3+ ---
4+
5+ Add chain icon to token selector in single chain mode
Original file line number Diff line number Diff line change @@ -4,19 +4,22 @@ import {
44 Button ,
55 Flex ,
66 Text ,
7- Box
7+ Box ,
8+ ChainTokenIcon
89} from '../../../../components/primitives/index.js'
910import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
1011import { faChevronDown , faCoins } from '@fortawesome/free-solid-svg-icons'
1112
1213type SwapWidgetTokenTriggerProps = {
1314 token ?: Token
1415 locked ?: boolean
16+ isSingleChainLocked ?: boolean
1517}
1618
1719export const SwapWidgetTokenTrigger : FC < SwapWidgetTokenTriggerProps > = ( {
1820 token,
19- locked
21+ locked,
22+ isSingleChainLocked
2023} ) => {
2124 const isValidTokenLogo = token ?. logoURI && token . logoURI !== 'missing.png'
2225
@@ -44,7 +47,13 @@ export const SwapWidgetTokenTrigger: FC<SwapWidgetTokenTriggerProps> = ({
4447 } }
4548 >
4649 < Flex align = "center" css = { { gap : '2' } } >
47- { isValidTokenLogo ? (
50+ { isSingleChainLocked ? (
51+ < ChainTokenIcon
52+ chainId = { token . chainId }
53+ tokenlogoURI = { token . logoURI }
54+ css = { { width : 24 , height : 24 } }
55+ />
56+ ) : isValidTokenLogo ? (
4857 < img
4958 alt = { token . name }
5059 src = { token . logoURI }
Original file line number Diff line number Diff line change @@ -439,6 +439,7 @@ const SwapWidget: FC<SwapWidgetProps> = ({
439439 token . chainId === fromToken ?. chainId
440440 ) . length === 1 )
441441 }
442+ isSingleChainLocked = { isSingleChainLocked }
442443 />
443444 </ div >
444445 }
@@ -750,6 +751,7 @@ const SwapWidget: FC<SwapWidgetProps> = ({
750751 token . chainId === toToken ?. chainId
751752 ) . length === 1 )
752753 }
754+ isSingleChainLocked = { isSingleChainLocked }
753755 />
754756 </ div >
755757 }
You can’t perform that action at this time.
0 commit comments