Skip to content

Commit

Permalink
fix: validate dom nesting console error
Browse files Browse the repository at this point in the history
  • Loading branch information
alter-eggo committed Aug 20, 2024
1 parent a774b66 commit fe21fa8
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions src/app/pages/home/components/account-actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useLocation, useNavigate } from 'react-router-dom';

import { ChainID } from '@stacks/transactions';
import { HomePageSelectors } from '@tests/selectors/home.selectors';
import { Flex } from 'leather-styles/jsx';
import { Box, Flex } from 'leather-styles/jsx';

import { whenStacksChainId } from '@leather.io/stacks';
import { CreditCardIcon, IconButton, InboxIcon, SwapIcon } from '@leather.io/ui';
Expand Down Expand Up @@ -56,14 +56,22 @@ export function AccountActions() {
)}
{whenStacksChainId(currentNetwork.chain.stacks.chainId)({
[ChainID.Mainnet]: (
<BasicTooltip label={swapsEnabled ? '' : <SwapsDisabledTooltipLabel />} side="left">
<IconButton
data-testid={HomePageSelectors.SwapBtn}
disabled={swapsBtnDisabled}
icon={<SwapIcon />}
label="Swap"
onClick={() => navigate(RouteUrls.Swap.replace(':base', 'STX').replace(':quote', ''))}
/>
<BasicTooltip
label={swapsEnabled ? '' : <SwapsDisabledTooltipLabel />}
side="left"
asChild
>
<Box>
<IconButton
data-testid={HomePageSelectors.SwapBtn}
disabled={swapsBtnDisabled}
icon={<SwapIcon />}
label="Swap"
onClick={() =>
navigate(RouteUrls.Swap.replace(':base', 'STX').replace(':quote', ''))
}
/>
</Box>
</BasicTooltip>
),
[ChainID.Testnet]: null,
Expand Down

0 comments on commit fe21fa8

Please sign in to comment.