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

Address breaking changes in UI library #6054

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from
Draft
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
8 changes: 4 additions & 4 deletions src/app/components/fees/fee-item-icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import type { FeeType } from '@app/common/fees/use-fees';
import { IconWrapper } from '../icon-wrapper';

const feeTypeToIconMap: Record<FeeType, ReactNode> = {
slow: <AnimalSnailIcon variant="small" />,
standard: <AnimalRabbitIcon variant="small" />,
fast: <AnimalEagleIcon variant="small" />,
custom: <AnimalChameleonIcon variant="small" />,
slow: <AnimalSnailIcon />,
standard: <AnimalRabbitIcon />,
fast: <AnimalEagleIcon />,
custom: <AnimalChameleonIcon />,
};

export function FeeItemIcon({ feeType }: { feeType: FeeType }) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createMoney, formatMoney, truncateMiddle } from '@leather.io/utils';

import { PsbtInput } from '@app/features/psbt-signer/hooks/use-parsed-inputs';
import { TagWithTooltip } from '@app/ui/components/tag/tag-with-tooltip';
import { BadgeWithTooltip } from '@app/ui/components/badge/badge-with-tooltip';

import { PsbtInputOutputItemLayout } from '../../psbt-input-output-item.layout';

Expand All @@ -15,7 +15,7 @@
amount={formatMoney(createMoney(utxo.value, 'BTC'))}
label={
utxo.toSign ? (
<TagWithTooltip hoverLabel={hoverLabel} label="Approve" transparent />
<BadgeWithTooltip hoverLabel={hoverLabel} label="Approve" outlined />

Check failure on line 18 in src/app/features/psbt-signer/components/psbt-inputs-and-outputs/components/psbt-input-list/components/psbt-input-item.tsx

View workflow job for this annotation

GitHub Actions / typecheck

Type '{ hoverLabel: string; label: string; outlined: true; }' is not assignable to type 'IntrinsicAttributes & BadgeWithTooltipProps'.
) : undefined
}
txId={truncateMiddle(utxo.txid)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createMoney, formatMoney, truncateMiddle } from '@leather.io/utils';

import { PsbtOutput } from '@app/features/psbt-signer/hooks/use-parsed-outputs';
import { TagWithTooltip } from '@app/ui/components/tag/tag-with-tooltip';
import { BadgeWithTooltip } from '@app/ui/components/badge/badge-with-tooltip';

import { PsbtInputOutputItemLayout } from '../../psbt-input-output-item.layout';

Expand All @@ -19,7 +19,7 @@
amount={formatMoney(createMoney(Number(output.value), 'BTC'))}
label={
output.toSign ? (
<TagWithTooltip transparent hoverLabel={hoverLabel} label="You" />
<BadgeWithTooltip outlined hoverLabel={hoverLabel} label="You" />

Check failure on line 22 in src/app/features/psbt-signer/components/psbt-inputs-and-outputs/components/psbt-output-list/components/psbt-output-item.tsx

View workflow job for this annotation

GitHub Actions / typecheck

Type '{ outlined: true; hoverLabel: string; label: string; }' is not assignable to type 'IntrinsicAttributes & BadgeWithTooltipProps'.
) : undefined
}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { LockIcon, UnlockIcon } from '@leather.io/ui';

import { usePsbtSignerContext } from '@app/features/psbt-signer/psbt-signer.context';
import { TagWithTooltip } from '@app/ui/components/tag/tag-with-tooltip';
import { BadgeWithTooltip } from '@app/ui/components/badge/badge-with-tooltip';

const immutableLabel =
'Any modification to the transaction, including the fee amount or other inputs/outputs, will invalidate the signature.';
Expand All @@ -16,12 +16,12 @@
return (
<HStack alignItems="center" gap="space.02">
<styled.h2 textStyle="heading.05">Transaction</styled.h2>
<TagWithTooltip
<BadgeWithTooltip
hoverLabel={isPsbtMutable ? uncertainLabel : immutableLabel}
icon={isPsbtMutable ? <UnlockIcon variant="small" /> : <LockIcon variant="small" />}

Check failure on line 21 in src/app/features/psbt-signer/components/psbt-request-details-header.tsx

View workflow job for this annotation

GitHub Actions / typecheck

Type '{ hoverLabel: string; icon: Element; label: string; variant: string; outlined: true; }' is not assignable to type 'IntrinsicAttributes & BadgeWithTooltipProps'.
label={isPsbtMutable ? 'Uncertain' : 'Certain'}
transparent
variant={isPsbtMutable ? 'warning' : 'default'}
outlined
/>
</HStack>
);
Expand Down
6 changes: 3 additions & 3 deletions src/app/pages/fund/components/fiat-provider-item.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FundPageSelectors } from '@tests/selectors/fund.selectors';

import { StarIcon, Tag, ZapIcon } from '@leather.io/ui';
import { Badge, StarIcon, ZapIcon } from '@leather.io/ui';

Check failure on line 3 in src/app/pages/fund/components/fiat-provider-item.tsx

View workflow job for this annotation

GitHub Actions / typecheck

Module '"@leather.io/ui"' has no exported member 'Badge'.

import { AvailableRegions } from '@app/query/common/remote-config/remote-config.query';

Expand Down Expand Up @@ -38,10 +38,10 @@
const Attributes = (
<>
{hasFastCheckoutProcess && (
<Tag icon={<ZapIcon variant="small" />} label="Fast checkout" variant="success" />
<Badge icon={<ZapIcon variant="small" />} label="Fast checkout" variant="success" />
)}
{!hasTradingFees && (
<Tag icon={<StarIcon variant="small" />} label="0 % Fees" variant="warning" />
<Badge icon={<StarIcon variant="small" />} label="0 % Fees" variant="warning" />
)}
</>
);
Expand Down
17 changes: 17 additions & 0 deletions src/app/ui/components/badge/badge-with-tooltip.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Badge, type BadgeProps } from '@leather.io/ui';

Check failure on line 1 in src/app/ui/components/badge/badge-with-tooltip.tsx

View workflow job for this annotation

GitHub Actions / typecheck

Module '"@leather.io/ui"' has no exported member 'Badge'.

Check failure on line 1 in src/app/ui/components/badge/badge-with-tooltip.tsx

View workflow job for this annotation

GitHub Actions / typecheck

'"@leather.io/ui"' has no exported member named 'BadgeProps'. Did you mean 'TagProps'?

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

type TooltipSideType = 'bottom' | 'left' | 'right' | 'top';

interface BadgeWithTooltipProps extends BadgeProps {
hoverLabel: string;
side?: TooltipSideType;
}
export function BadgeWithTooltip({ hoverLabel, side = 'bottom', ...props }: BadgeWithTooltipProps) {
return (
<BasicTooltip label={hoverLabel} side={side}>
<Badge {...props} />
</BasicTooltip>
);
}
21 changes: 0 additions & 21 deletions src/app/ui/components/tag/tag-with-tooltip.tsx

This file was deleted.

Loading