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

refactor: remove borders from amount label #656

Merged
merged 13 commits into from
Sep 19, 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
6 changes: 3 additions & 3 deletions src/app/components/Amount/AmountLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ export const AmountLabel: React.VFC<AmountLabelProperties> = ({
return (
<Label
color={labelColor as any}
noBorder={isCompact}
noBorder
className={twMerge(
cn("rounded", {
cn("flex h-full items-center justify-center rounded", {
"pr-1.5": hint,
"px-1.5": !hint,
}),
Expand All @@ -72,7 +72,7 @@ export const AmountLabel: React.VFC<AmountLabelProperties> = ({
size={size}
data-testid="AmountLabel__wrapper"
>
<div className={cn("flex space-x-1", isCompact ? "items-center" : "items-stretch")}>
<div className={cn("flex items-center space-x-1")}>
{hint && <AmountLabelHint tooltipContent={hint} className={hintClassName} isCompact={isCompact} />}
<Amount
showSign={value !== 0}
Expand Down
24 changes: 12 additions & 12 deletions src/app/components/Amount/__snapshots__/AmountLabel.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
exports[`AmountLabel > should render 1`] = `
<DocumentFragment>
<div
class="rounded px-1.5 css-givenh"
class="flex h-full items-center justify-center rounded px-1.5 css-1jspzfx"
color="success-bg"
data-testid="AmountLabel__wrapper"
>
<div
class="flex space-x-1 items-stretch"
class="flex items-center space-x-1"
>
<span
class="whitespace-nowrap text-sm"
Expand All @@ -24,12 +24,12 @@ exports[`AmountLabel > should render 1`] = `
exports[`AmountLabel > should render compact 1`] = `
<DocumentFragment>
<div
class="rounded px-1.5 css-1jspzfx"
class="flex h-full items-center justify-center rounded px-1.5 css-1jspzfx"
color="success-bg"
data-testid="AmountLabel__wrapper"
>
<div
class="flex space-x-1 items-center"
class="flex items-center space-x-1"
>
<span
class="whitespace-nowrap text-sm"
Expand All @@ -45,12 +45,12 @@ exports[`AmountLabel > should render compact 1`] = `
exports[`AmountLabel > should render compact with hint 1`] = `
<DocumentFragment>
<div
class="rounded pr-1.5 css-1jspzfx"
class="flex h-full items-center justify-center rounded pr-1.5 css-1jspzfx"
color="success-bg"
data-testid="AmountLabel__wrapper"
>
<div
class="flex space-x-1 items-center"
class="flex items-center space-x-1"
>
<div
aria-describedby="tippy-2"
Expand Down Expand Up @@ -101,12 +101,12 @@ exports[`AmountLabel > should render compact with hint 1`] = `
exports[`AmountLabel > should render negative 1`] = `
<DocumentFragment>
<div
class="rounded px-1.5 css-1pbju28"
class="flex h-full items-center justify-center rounded px-1.5 css-xqt0aw"
color="danger-bg"
data-testid="AmountLabel__wrapper"
>
<div
class="flex space-x-1 items-stretch"
class="flex items-center space-x-1"
>
<span
class="whitespace-nowrap text-sm"
Expand All @@ -122,12 +122,12 @@ exports[`AmountLabel > should render negative 1`] = `
exports[`AmountLabel > should render with hint 1`] = `
<DocumentFragment>
<div
class="rounded pr-1.5 css-givenh"
class="flex h-full items-center justify-center rounded pr-1.5 css-1jspzfx"
color="success-bg"
data-testid="AmountLabel__wrapper"
>
<div
class="flex space-x-1 items-stretch"
class="flex items-center space-x-1"
>
<div
aria-describedby="tippy-1"
Expand Down Expand Up @@ -178,12 +178,12 @@ exports[`AmountLabel > should render with hint 1`] = `
exports[`AmountLabel > should render zero 1`] = `
<DocumentFragment>
<div
class="rounded px-1.5 css-vy12ck"
class="flex h-full items-center justify-center rounded px-1.5 css-1vn5kd9"
color="neutral"
data-testid="AmountLabel__wrapper"
>
<div
class="flex space-x-1 items-stretch"
class="flex items-center space-x-1"
>
<span
class="whitespace-nowrap text-sm"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ exports[`Notifications > should render in xs 1`] = `
Amount
</div>
<div
class="rounded px-1.5 css-givenh"
class="flex h-full items-center justify-center rounded px-1.5 css-1jspzfx"
color="success-bg"
data-testid="AmountLabel__wrapper"
>
<div
class="flex space-x-1 items-stretch"
class="flex items-center space-x-1"
>
<span
class="whitespace-nowrap text-sm"
Expand Down Expand Up @@ -148,12 +148,12 @@ exports[`Notifications > should render in xs 2`] = `
Amount
</div>
<div
class="rounded px-1.5 css-givenh"
class="flex h-full items-center justify-center rounded px-1.5 css-1jspzfx"
color="success-bg"
data-testid="AmountLabel__wrapper"
>
<div
class="flex space-x-1 items-stretch"
class="flex items-center space-x-1"
>
<span
class="whitespace-nowrap text-sm"
Expand Down Expand Up @@ -268,12 +268,12 @@ exports[`Notifications > should render in xs 3`] = `
class="flex items-center px-3 my-1 transition-colors duration-100 min-h-11 pr-6 rounded-r justify-end"
>
<div
class="rounded px-1.5 css-1jspzfx"
class="flex h-full items-center justify-center rounded px-1.5 css-1jspzfx"
color="success-bg"
data-testid="AmountLabel__wrapper"
>
<div
class="flex space-x-1 items-center"
class="flex items-center space-x-1"
>
<span
class="whitespace-nowrap text-sm"
Expand Down Expand Up @@ -388,12 +388,12 @@ exports[`Notifications > should render in xs 4`] = `
class="flex items-center px-3 my-1 transition-colors duration-100 min-h-11 pr-6 rounded-r justify-end"
>
<div
class="rounded px-1.5 css-1jspzfx"
class="flex h-full items-center justify-center rounded px-1.5 css-1jspzfx"
color="success-bg"
data-testid="AmountLabel__wrapper"
>
<div
class="flex space-x-1 items-center"
class="flex items-center space-x-1"
>
<span
class="whitespace-nowrap text-sm"
Expand Down Expand Up @@ -508,12 +508,12 @@ exports[`Notifications > should render in xs 5`] = `
class="flex items-center px-3 my-1 transition-colors duration-100 min-h-11 pr-6 rounded-r justify-end"
>
<div
class="rounded px-1.5 css-1jspzfx"
class="flex h-full items-center justify-center rounded px-1.5 css-1jspzfx"
color="success-bg"
data-testid="AmountLabel__wrapper"
>
<div
class="flex space-x-1 items-center"
class="flex items-center space-x-1"
>
<span
class="whitespace-nowrap text-sm"
Expand Down Expand Up @@ -628,12 +628,12 @@ exports[`Notifications > should render notification item 1`] = `
class="flex items-center px-3 my-1 transition-colors duration-100 min-h-11 pr-6 rounded-r justify-end"
>
<div
class="rounded px-1.5 css-1jspzfx"
class="flex h-full items-center justify-center rounded px-1.5 css-1jspzfx"
color="success-bg"
data-testid="AmountLabel__wrapper"
>
<div
class="flex space-x-1 items-center"
class="flex items-center space-x-1"
>
<span
class="whitespace-nowrap text-sm"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,12 @@ exports[`Notifications > should emit transactionClick event 1`] = `
class="flex items-center px-3 my-1 transition-colors duration-100 min-h-11 pr-6 rounded-r justify-end"
>
<div
class="rounded px-1.5 css-xqt0aw"
class="flex h-full items-center justify-center rounded px-1.5 css-xqt0aw"
color="danger-bg"
data-testid="AmountLabel__wrapper"
>
<div
class="flex space-x-1 items-center"
class="flex items-center space-x-1"
>
<span
class="whitespace-nowrap text-sm"
Expand Down Expand Up @@ -327,12 +327,12 @@ exports[`Notifications > should emit transactionClick event 1`] = `
class="flex items-center px-3 my-1 transition-colors duration-100 min-h-11 pr-6 rounded-r justify-end"
>
<div
class="rounded px-1.5 css-1jspzfx"
class="flex h-full items-center justify-center rounded px-1.5 css-1jspzfx"
color="success-bg"
data-testid="AmountLabel__wrapper"
>
<div
class="flex space-x-1 items-center"
class="flex items-center space-x-1"
>
<span
class="whitespace-nowrap text-sm"
Expand Down Expand Up @@ -438,12 +438,12 @@ exports[`Notifications > should emit transactionClick event 1`] = `
class="flex items-center px-3 my-1 transition-colors duration-100 min-h-11 pr-6 rounded-r justify-end"
>
<div
class="rounded px-1.5 css-1jspzfx"
class="flex h-full items-center justify-center rounded px-1.5 css-1jspzfx"
color="success-bg"
data-testid="AmountLabel__wrapper"
>
<div
class="flex space-x-1 items-center"
class="flex items-center space-x-1"
>
<span
class="whitespace-nowrap text-sm"
Expand Down Expand Up @@ -771,12 +771,12 @@ exports[`Notifications > should render with plugins 1`] = `
class="flex items-center px-3 my-1 transition-colors duration-100 min-h-11 pr-6 rounded-r justify-end"
>
<div
class="rounded px-1.5 css-xqt0aw"
class="flex h-full items-center justify-center rounded px-1.5 css-xqt0aw"
color="danger-bg"
data-testid="AmountLabel__wrapper"
>
<div
class="flex space-x-1 items-center"
class="flex items-center space-x-1"
>
<span
class="whitespace-nowrap text-sm"
Expand Down Expand Up @@ -882,12 +882,12 @@ exports[`Notifications > should render with plugins 1`] = `
class="flex items-center px-3 my-1 transition-colors duration-100 min-h-11 pr-6 rounded-r justify-end"
>
<div
class="rounded px-1.5 css-1jspzfx"
class="flex h-full items-center justify-center rounded px-1.5 css-1jspzfx"
color="success-bg"
data-testid="AmountLabel__wrapper"
>
<div
class="flex space-x-1 items-center"
class="flex items-center space-x-1"
>
<span
class="whitespace-nowrap text-sm"
Expand Down Expand Up @@ -993,12 +993,12 @@ exports[`Notifications > should render with plugins 1`] = `
class="flex items-center px-3 my-1 transition-colors duration-100 min-h-11 pr-6 rounded-r justify-end"
>
<div
class="rounded px-1.5 css-1jspzfx"
class="flex h-full items-center justify-center rounded px-1.5 css-1jspzfx"
color="success-bg"
data-testid="AmountLabel__wrapper"
>
<div
class="flex space-x-1 items-center"
class="flex items-center space-x-1"
>
<span
class="whitespace-nowrap text-sm"
Expand Down Expand Up @@ -1238,12 +1238,12 @@ exports[`Notifications > should render with transactions and plugins 1`] = `
class="flex items-center px-3 my-1 transition-colors duration-100 min-h-11 pr-6 rounded-r justify-end"
>
<div
class="rounded px-1.5 css-xqt0aw"
class="flex h-full items-center justify-center rounded px-1.5 css-xqt0aw"
color="danger-bg"
data-testid="AmountLabel__wrapper"
>
<div
class="flex space-x-1 items-center"
class="flex items-center space-x-1"
>
<span
class="whitespace-nowrap text-sm"
Expand Down Expand Up @@ -1349,12 +1349,12 @@ exports[`Notifications > should render with transactions and plugins 1`] = `
class="flex items-center px-3 my-1 transition-colors duration-100 min-h-11 pr-6 rounded-r justify-end"
>
<div
class="rounded px-1.5 css-1jspzfx"
class="flex h-full items-center justify-center rounded px-1.5 css-1jspzfx"
color="success-bg"
data-testid="AmountLabel__wrapper"
>
<div
class="flex space-x-1 items-center"
class="flex items-center space-x-1"
>
<span
class="whitespace-nowrap text-sm"
Expand Down Expand Up @@ -1460,12 +1460,12 @@ exports[`Notifications > should render with transactions and plugins 1`] = `
class="flex items-center px-3 my-1 transition-colors duration-100 min-h-11 pr-6 rounded-r justify-end"
>
<div
class="rounded px-1.5 css-1jspzfx"
class="flex h-full items-center justify-center rounded px-1.5 css-1jspzfx"
color="success-bg"
data-testid="AmountLabel__wrapper"
>
<div
class="flex space-x-1 items-center"
class="flex items-center space-x-1"
>
<span
class="whitespace-nowrap text-sm"
Expand Down
Loading
Loading