Skip to content

Commit 2f9cc00

Browse files
committed
fix: cards and buttons
1 parent d9a1177 commit 2f9cc00

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/components/Button.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,25 @@ export const buttonVariables = cssVariables(
2727

2828
const { vars, v } = buttonVariables
2929

30+
const paddingMap = {
31+
none: 'padding: 0;',
32+
normal: 'padding: 12px 16px;',
33+
}
34+
3035
interface ButtonContainerProps {
3136
circle: boolean
3237
fullWidth: boolean
38+
padding: 'none' | 'normal'
3339
}
3440

3541
const ButtonContainer = styled.button<ButtonContainerProps>`
3642
${cssClickable}
3743
${({ fullWidth }) => fullWidth && 'width: 100%;'}
44+
${({ padding }) => paddingMap[padding]}
3845
display: inline-block;
3946
vertical-align: middle;
4047
text-align: center;
4148
background: ${v.backgroundColor};
42-
padding: 0;
4349
color: ${v.textColor};
4450
transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease,
4551
box-shadow 0.3s ease;
@@ -104,6 +110,7 @@ export const Button = React.forwardRef(
104110
disabled={disabled}
105111
circle={circle}
106112
fullWidth={fullWidth}
113+
padding={padding}
107114
style={{
108115
[vars.backgroundColor]: computedBackgroundColor,
109116
[vars.hoverBackgroundColor]: computedHoverColor,
@@ -123,9 +130,7 @@ export const Button = React.forwardRef(
123130
}}
124131
{...rest}
125132
>
126-
<div style={{ padding: padding === 'none' ? 'unset' : '12px 16px' }}>
127-
{children}
128-
</div>
133+
<div>{children}</div>
129134
</ButtonContainer>
130135
)
131136
}

src/components/Card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export const Card = React.forwardRef(
9696
}}
9797
{...rest}
9898
>
99-
{children}
99+
<div>{children}</div>
100100
</CardContainer>
101101
)
102102
}

0 commit comments

Comments
 (0)