Skip to content

Commit ac5eab3

Browse files
committed
[#48] 💄 change default padding & margin in Box component
1 parent b040e18 commit ac5eab3

File tree

1 file changed

+5
-6
lines changed
  • src/components/common/containers

1 file changed

+5
-6
lines changed

‎src/components/common/containers/Box.tsx‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,16 @@ import { twMerge } from 'tailwind-merge'
22

33
type Variant = 'contained' | 'outlined'
44
type Rounded = 8 | 12
5-
type Padding = 0 | 10 | 20 | 30 | 40
5+
type Padding = 0 | 10 | 20 | 30 | 32 | 40
66
type Margin = 0 | 10 | 20 | 30 | 40
77
type Color = 'primary' | 'secondary' | 'tertiary'
88

9-
interface BoxProps {
10-
children: React.ReactNode
9+
interface BoxProps extends React.HTMLAttributes<HTMLDivElement> {
1110
variant?: Variant
1211
rounded?: Rounded
1312
padding?: Padding
1413
margin?: Margin
1514
color?: Color
16-
className?: string
1715
}
1816

1917
const BaseStyle = 'flex items-center justify-center w-full'
@@ -33,6 +31,7 @@ const styleByPadding: Record<Padding, string> = {
3331
10: 'p-10',
3432
20: 'p-20',
3533
30: 'p-30',
34+
32: 'p-32',
3635
40: 'p-40',
3736
}
3837

@@ -54,8 +53,8 @@ export const Box = ({
5453
children,
5554
variant = 'outlined',
5655
rounded = 12,
57-
padding = 20,
58-
margin = 10,
56+
padding = 0,
57+
margin = 0,
5958
color = 'primary',
6059
className = '',
6160
}: BoxProps): JSX.Element => {

0 commit comments

Comments
 (0)