Skip to content

Commit b75976a

Browse files
authored
✨ feat: add common button component (#10)
* ✨ feat: add common button component * 🔥 remove: remove line height on button component css
1 parent 7609abf commit b75976a

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

src/components/Button.module.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.button {
2+
width: 100%;
3+
background-color: var(--violet);
4+
border-radius: 8px;
5+
font-size: 14px;
6+
font-weight: 600;
7+
color: var(--white);
8+
}
9+
10+
.button:disabled {
11+
background-color: var(--gray-400);
12+
cursor: auto;
13+
}

src/components/Button.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { ButtonHTMLAttributes, PropsWithChildren } from 'react';
2+
import styles from './Button.module.css';
3+
4+
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
5+
className?: string;
6+
}
7+
8+
export default function Button({
9+
className = '',
10+
children,
11+
...props
12+
}: PropsWithChildren<ButtonProps>) {
13+
return (
14+
<button className={`${styles.button} ${className}`} {...props}>
15+
{children}
16+
</button>
17+
);
18+
}

0 commit comments

Comments
 (0)