Skip to content

Commit 00fbf1e

Browse files
committed
Fix table component structure
1 parent 4b4824e commit 00fbf1e

File tree

1 file changed

+27
-65
lines changed
  • apps/landing/src/app/(detail)/components

1 file changed

+27
-65
lines changed
Lines changed: 27 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,100 +1,62 @@
1-
import { Box, css } from '@devup-ui/react'
2-
import clsx from 'clsx'
1+
import { Box } from '@devup-ui/react'
32

4-
export function Table({
5-
children,
6-
className,
7-
...props
8-
}: React.ComponentProps<'table'>) {
3+
export function Table(props: React.ComponentProps<'table'>) {
94
return (
105
<Box
116
as="table"
12-
className={clsx(
13-
css({
14-
border: 'none',
15-
styleOrder: 1,
16-
}),
17-
className,
18-
)}
7+
border="none"
198
selectors={{
209
'& th, & td': {
2110
border: 'none',
2211
minWidth: '200px',
2312
},
2413
}}
14+
styleOrder={1}
2515
{...props}
26-
>
27-
{children}
28-
</Box>
16+
/>
2917
)
3018
}
3119

32-
export function Tr({ children, ...props }: React.ComponentProps<'tr'>) {
20+
export function Tr(props: React.ComponentProps<'tr'>) {
3321
return (
3422
<Box
3523
as="tr"
36-
className={css({
37-
borderTop: '1px solid $border',
38-
borderBottom: '1px solid $border',
39-
})}
24+
borderBottom="1px solid $border"
25+
borderTop="1px solid $border"
4026
{...props}
41-
>
42-
{children}
43-
</Box>
27+
/>
4428
)
4529
}
4630

47-
export function Td({
48-
children,
49-
className,
50-
...props
51-
}: React.ComponentProps<'td'>) {
31+
export function Td(props: React.ComponentProps<'td'>) {
5232
return (
5333
<Box
5434
as="td"
55-
className={clsx(
56-
css({
57-
border: 'none',
58-
py: '14px',
59-
px: '20px',
60-
width: 'fit-content',
61-
styleOrder: 1,
62-
}),
63-
className,
64-
)}
35+
border="none"
36+
px="20px"
37+
py="14px"
38+
styleOrder={1}
39+
width="fit-content"
6540
{...props}
66-
>
67-
{children}
68-
</Box>
41+
/>
6942
)
7043
}
7144

72-
export function Th({
73-
children,
74-
className,
75-
...props
76-
}: React.ComponentProps<'th'>) {
45+
export function Th(props: React.ComponentProps<'th'>) {
7746
return (
7847
<Box
7948
as="th"
49+
bg="$cardBg"
8050
border="none"
81-
className={clsx(
82-
css({
83-
py: '14px',
84-
px: '20px',
85-
color: '$captionBold',
86-
typography: 'bodyBold',
87-
borderTop: '1px solid $border',
88-
borderBottom: '1px solid $border',
89-
bg: '$cardBg',
90-
textAlign: 'left',
91-
styleOrder: 1,
92-
}),
93-
className,
94-
)}
51+
borderBottom="1px solid $border"
52+
borderTop="1px solid $border"
53+
color="$captionBold"
54+
px="20px"
55+
py="14px"
56+
styleOrder={1}
57+
textAlign="left"
58+
typography="bodyBold"
9559
{...props}
96-
>
97-
{children}
98-
</Box>
60+
/>
9961
)
10062
}

0 commit comments

Comments
 (0)