Skip to content

Commit a96407a

Browse files
refactor: address breaking changes in ui badge
- tag was renamed to badge - transparent prop was renamed to outlined
1 parent 30a2d8e commit a96407a

File tree

6 files changed

+27
-31
lines changed

6 files changed

+27
-31
lines changed

src/app/features/psbt-signer/components/psbt-inputs-and-outputs/components/psbt-input-list/components/psbt-input-item.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { createMoney, formatMoney, truncateMiddle } from '@leather.io/utils';
22

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

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

@@ -15,7 +15,7 @@ export function PsbtInputItem({ utxo }: { utxo: PsbtInput }) {
1515
amount={formatMoney(createMoney(utxo.value, 'BTC'))}
1616
label={
1717
utxo.toSign ? (
18-
<TagWithTooltip hoverLabel={hoverLabel} label="Approve" transparent />
18+
<BadgeWithTooltip hoverLabel={hoverLabel} label="Approve" outlined />
1919
) : undefined
2020
}
2121
txId={truncateMiddle(utxo.txid)}

src/app/features/psbt-signer/components/psbt-inputs-and-outputs/components/psbt-output-list/components/psbt-output-item.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { createMoney, formatMoney, truncateMiddle } from '@leather.io/utils';
22

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

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

@@ -19,7 +19,7 @@ export function PsbtOutputItem({ output }: { output: PsbtOutput }) {
1919
amount={formatMoney(createMoney(Number(output.value), 'BTC'))}
2020
label={
2121
output.toSign ? (
22-
<TagWithTooltip transparent hoverLabel={hoverLabel} label="You" />
22+
<BadgeWithTooltip outlined hoverLabel={hoverLabel} label="You" />
2323
) : undefined
2424
}
2525
/>

src/app/features/psbt-signer/components/psbt-request-details-header.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { HStack, styled } from 'leather-styles/jsx';
33
import { LockIcon, UnlockIcon } from '@leather.io/ui';
44

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

88
const immutableLabel =
99
'Any modification to the transaction, including the fee amount or other inputs/outputs, will invalidate the signature.';
@@ -16,12 +16,12 @@ export function PsbtRequestDetailsHeader() {
1616
return (
1717
<HStack alignItems="center" gap="space.02">
1818
<styled.h2 textStyle="heading.05">Transaction</styled.h2>
19-
<TagWithTooltip
19+
<BadgeWithTooltip
2020
hoverLabel={isPsbtMutable ? uncertainLabel : immutableLabel}
2121
icon={isPsbtMutable ? <UnlockIcon variant="small" /> : <LockIcon variant="small" />}
2222
label={isPsbtMutable ? 'Uncertain' : 'Certain'}
23-
transparent
2423
variant={isPsbtMutable ? 'warning' : 'default'}
24+
outlined
2525
/>
2626
</HStack>
2727
);

src/app/pages/fund/components/fiat-provider-item.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { FundPageSelectors } from '@tests/selectors/fund.selectors';
22

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

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

@@ -38,10 +38,10 @@ export function FiatProviderItem(props: FiatProviderProps) {
3838
const Attributes = (
3939
<>
4040
{hasFastCheckoutProcess && (
41-
<Tag icon={<ZapIcon variant="small" />} label="Fast checkout" variant="success" />
41+
<Badge icon={<ZapIcon variant="small" />} label="Fast checkout" variant="success" />
4242
)}
4343
{!hasTradingFees && (
44-
<Tag icon={<StarIcon variant="small" />} label="0 % Fees" variant="warning" />
44+
<Badge icon={<StarIcon variant="small" />} label="0 % Fees" variant="warning" />
4545
)}
4646
</>
4747
);
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { Badge, type BadgeProps } from '@leather.io/ui';
2+
3+
import { BasicTooltip } from '../tooltip/basic-tooltip';
4+
5+
type TooltipSideType = 'bottom' | 'left' | 'right' | 'top';
6+
7+
interface BadgeWithTooltipProps extends BadgeProps {
8+
hoverLabel: string;
9+
side?: TooltipSideType;
10+
}
11+
export function BadgeWithTooltip({ hoverLabel, side = 'bottom', ...props }: BadgeWithTooltipProps) {
12+
return (
13+
<BasicTooltip label={hoverLabel} side={side}>
14+
<Badge {...props} />
15+
</BasicTooltip>
16+
);
17+
}

src/app/ui/components/tag/tag-with-tooltip.tsx

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)