Skip to content

Commit 8cbc2a8

Browse files
committed
refactor: layout components
Signed-off-by: Adam Setch <[email protected]>
1 parent 8d357a8 commit 8cbc2a8

19 files changed

+1032
-343
lines changed

src/renderer/components/fields/Checkbox.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import { Stack } from '@primer/react';
12
import type { FC, ReactNode } from 'react';
23

3-
import { CounterLabel, Stack } from '@primer/react';
4-
54
import { cn } from '../../utils/cn';
5+
import { CustomCounter } from '../primitives/CustomCounter';
66
import { Tooltip } from './Tooltip';
77

88
export interface ICheckbox {
@@ -20,7 +20,7 @@ export const Checkbox: FC<ICheckbox> = ({
2020
visible = true,
2121
...props
2222
}: ICheckbox) => {
23-
const counter = props.counter > 0 ? props.counter : undefined;
23+
const counter = props?.counter === 0 ? '0' : props.counter;
2424

2525
return (
2626
visible && (
@@ -54,11 +54,12 @@ export const Checkbox: FC<ICheckbox> = ({
5454
<Tooltip name={`tooltip-${props.name}`} tooltip={props.tooltip} />
5555
)}
5656

57-
{counter ? (
58-
<CounterLabel scheme={props.checked ? 'primary' : 'secondary'}>
59-
{counter}
60-
</CounterLabel>
61-
) : null}
57+
{counter && (
58+
<CustomCounter
59+
scheme={props.checked ? 'primary' : 'secondary'}
60+
value={counter}
61+
/>
62+
)}
6263
</Stack>
6364
)
6465
);

src/renderer/components/fields/__snapshots__/Checkbox.test.tsx.snap

Lines changed: 14 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/renderer/components/filters/UserTypeFilter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const UserTypeFilter: FC = () => {
2626

2727
return (
2828
<fieldset id="filter-user-types">
29-
<Stack direction="horizontal" gap="condensed" align="baseline">
29+
<Stack direction="horizontal" gap="condensed">
3030
<Title icon={FeedPersonIcon}>User Type</Title>
3131
<Tooltip
3232
name="tooltip-filter-user-type"

0 commit comments

Comments
 (0)