Skip to content

Commit

Permalink
Update AssetChainDropdown.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
reallybeard committed Aug 11, 2023
1 parent af10496 commit 644d3d0
Showing 1 changed file with 17 additions and 20 deletions.
37 changes: 17 additions & 20 deletions src/components/MultiHopTrade/components/AssetChainDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ const AssetChainRow: React.FC<{ assetId: AssetId } & FlexProps> = ({ assetId, ..
return (
<Flex alignItems='center' gap={2} {...rest}>
<AssetIcon size='xs' src={iconSrc} />
{/* <RawText className='chain-name'>{feeAsset?.networkName ?? feeAsset?.name}</RawText> */}
<AutoTruncateText value={feeAsset?.networkName ?? feeAsset?.name} />
</Flex>
)
Expand Down Expand Up @@ -71,29 +70,27 @@ export const AssetChainDropdown: React.FC<ChainDropdownProps> = ({

const onChange = useCallback((value: string | string[]) => onClick(value as AssetId), [onClick])

if (isLoading) {
return <Skeleton width='80px' height='40px' borderRadius='full' />
}

if (!assetId) return null

return (
<Menu {...menuProps}>
<MenuButton
as={Button}
justifyContent='flex-end'
height='auto'
px={2}
py={2}
gap={2}
size='sm'
borderRadius='full'
isDisabled={!assetIds?.length}
rightIcon={<ChevronDownIcon />}
{...buttonProps}
>
<AssetChainRow className='activeChain' assetId={assetId} />
</MenuButton>
<Skeleton borderRadius='full' isLoaded={!isLoading}>
<MenuButton
as={Button}
justifyContent='flex-end'
height='auto'
px={2}
py={2}
gap={2}
size='sm'
borderRadius='full'
isDisabled={!assetIds?.length}
rightIcon={<ChevronDownIcon />}
{...buttonProps}
>
<AssetChainRow className='activeChain' assetId={assetId} />
</MenuButton>
</Skeleton>
<MenuList zIndex='banner'>
<MenuOptionGroup type='radio' value={assetId} onChange={onChange}>
{showAll && (
Expand Down

0 comments on commit 644d3d0

Please sign in to comment.