Skip to content

Commit b81a3f8

Browse files
committed
feat : button 컴포넌트 일부 제작
1 parent ddee2e8 commit b81a3f8

File tree

1 file changed

+30
-3
lines changed

1 file changed

+30
-3
lines changed

apps/web/src/components/button.tsx

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,38 @@
11
"use client";
22

3+
import clsx from "clsx";
4+
35
interface ButtonProps {
4-
children?: string;
6+
children: React.ReactNode;
7+
size?: "small" | "medium" | "large";
8+
backColor?: string;
9+
textColor?: string;
10+
borderColor?: string;
511
}
612

7-
const Button = ({ children }: ButtonProps) => {
8-
return <div>{children}</div>;
13+
const Button = ({
14+
children,
15+
size,
16+
backColor,
17+
textColor,
18+
borderColor,
19+
}: ButtonProps) => {
20+
return (
21+
<div
22+
className={clsx(
23+
"flex items-center justify-center rounded-lg cursor-pointer hover:bg-blue-500",
24+
{
25+
"px-4 py-2 text-b2": size === "small",
26+
"px-6 py-3 text-b2": size === "medium",
27+
"w-[27rem] h-[3rem] text-b2": size === "large",
28+
},
29+
{ "bg-blue-600 text-white": backColor === "blue" },
30+
{ "border border-blue-600": borderColor === "blue" },
31+
)}
32+
>
33+
{children}
34+
</div>
35+
);
936
};
1037

1138
export default Button;

0 commit comments

Comments
 (0)