Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: utxo protection dropdown #6045

Merged
merged 1 commit into from
Dec 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions src/app/features/collectibles/components/bitcoin/inscription.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useCallback, useMemo } from 'react';
import { useLocation, useNavigate } from 'react-router-dom';

import { Box } from 'leather-styles/jsx';
import { Box, styled } from 'leather-styles/jsx';

import { type Inscription } from '@leather.io/models';
import {
Expand Down Expand Up @@ -136,22 +136,36 @@ export function Inscription({ inscription }: InscriptionProps) {
_focus={{ outline: 'focus' }}
_hover={{ bg: 'ink.component-background-hover' }}
bg="ink.background-primary"
border="1px solid"
borderColor="ink.text-primary"
borderRadius="2px"
transform="rotate(90deg)"
color="ink.action-primary-default"
icon={<EllipsisVIcon variant="small" />}
icon={<EllipsisVIcon />}
/>
</DropdownMenu.Trigger>
<DropdownMenu.Content side="bottom">
<DropdownMenu.Content
align="end"
side="bottom"
sideOffset={4}
style={{ padding: '8px' }}
>
<DropdownMenu.Item onClick={() => openInscriptionUrl(inscription.number)}>
<Flag img={<ExternalLinkIcon variant="small" />}>Open original</Flag>
<Flag img={<ExternalLinkIcon />}>
<styled.span textStyle="label.02">Open original</styled.span>
</Flag>
</DropdownMenu.Item>
{hasInscriptionBeenDiscarded(inscription) ? (
<DropdownMenu.Item onClick={() => recoverInscription(inscription)}>
<Flag img={<LockIcon variant="small" />}>Protect</Flag>
<Flag img={<LockIcon />}>
<styled.span textStyle="label.02">Protect</styled.span>
</Flag>
</DropdownMenu.Item>
) : (
<DropdownMenu.Item onClick={() => discardInscription(inscription)}>
<Flag img={<UnlockIcon variant="small" />}>Unprotect</Flag>
<Flag img={<UnlockIcon />}>
<styled.span textStyle="label.02">Unprotect</styled.span>
</Flag>
</DropdownMenu.Item>
)}
</DropdownMenu.Content>
Expand Down
8 changes: 4 additions & 4 deletions src/app/ui/components/account/account.card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ import { PrivateTextLayout } from '@app/components/privacy/private-text.layout';

import { BasicTooltip } from '../tooltip/basic-tooltip';

const availableBalanceTooltipLabel =
'Total balance minus outbound transfers, protected collectibles and uneconomical UTXOs.';

interface AccountCardProps {
name: string;
availableBalance: string;
Expand Down Expand Up @@ -109,10 +112,7 @@ export function AccountCard({
<styled.h2 textStyle="label.02" color="ink.text-subdued" mt="space.01">
Available balance:
<styled.span ml="space.01">
<BasicTooltip
side={tooltipSide}
label="Some funds may be unavailable to protect your collectible assets. Disable protection to access your remaining balance."
>
<BasicTooltip side={tooltipSide} label={availableBalanceTooltipLabel}>
<Flag
reverse
spacing="space.01"
Expand Down
Loading