Skip to content

Commit

Permalink
feat: add link in swaps disabled tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
alter-eggo committed May 17, 2024
1 parent e34d5f3 commit 93f8964
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/app/pages/home/components/account-actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { BasicTooltip } from '@app/ui/components/tooltip/basic-tooltip';
import { CreditCardIcon, InboxIcon, SwapIcon } from '@app/ui/icons';

import { SendButton } from './send-button';
import { SwapsDisabledTooltipLabel } from './swaps-disabled-tooltip-label';

export function AccountActions() {
const navigate = useNavigate();
Expand Down Expand Up @@ -55,7 +56,7 @@ export function AccountActions() {
)}
{whenStacksChainId(currentNetwork.chain.stacks.chainId)({
[ChainID.Mainnet]: (
<BasicTooltip label={swapsEnabled ? '' : 'Swaps temporarily disabled'} side="left">
<BasicTooltip label={swapsEnabled ? '' : <SwapsDisabledTooltipLabel />} side="left">
<IconButton
data-testid={HomePageSelectors.SwapBtn}
disabled={swapsBtnDisabled}
Expand Down
19 changes: 19 additions & 0 deletions src/app/pages/home/components/swaps-disabled-tooltip-label.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Stack, styled } from 'leather-styles/jsx';

import { Link } from '@app/ui/components/link/link';

export function SwapsDisabledTooltipLabel() {
return (
<Stack gap="0">
<styled.span textStyle="caption.01">Swaps temporarily disabled</styled.span>
<Link
href="https://leather.io/guides/integrated-swap-disabled"
target="_blank"
color="ink.background-primary"
width="fit-content"
>
<styled.span textStyle="caption.01">Learn more</styled.span>
</Link>
</Stack>
);
}
2 changes: 1 addition & 1 deletion src/app/ui/components/tooltip/basic-tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Tooltip } from './tooltip';

interface BasicTooltipProps {
children: ReactNode;
label?: string;
label?: string | ReactNode;
disabled?: boolean;
side?: RadixTooltip.TooltipContentProps['side'];
asChild?: boolean;
Expand Down

0 comments on commit 93f8964

Please sign in to comment.