Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions components/Button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import React, { ReactNode, ButtonHTMLAttributes } from "react";

interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
children: ReactNode;
width?: string;
height?: string;
radius?: string;
color?: "positive" | "negative";
size?: string;
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

onClick, disabled 도 옵셔널로 추가되었으면 좋겠습니다

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

button type="button/submit"이것도 받아야하지않을까요?

const Button = ({
children,
width = "auto",
height = "53px",
radius = "8px",
color = "positive",
size = "18px",
...props
}: ButtonProps) => {
const backgroundStyle =
color === "positive"
? "linear-gradient(90.99deg, #6D6AFE 0.12%, #6AE3FE 101.84%)"
: "#FF5B56";

return (
<button
style={{
width,
height,
borderRadius: radius,
background: backgroundStyle,
fontSize: size,
}}
className="flex justify-center items-center text-white font-[600] whitespace-nowrap hover:opacity-90"
{...props}
>
{children}
</button>
);
};

export default Button;
1 change: 1 addition & 0 deletions styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

:root {
--background: #ffffff;
--white200: #f5f5f5;
--black100: #000;
--black200: #111322;
--black300: #373740;
Expand Down
1 change: 1 addition & 0 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const config: Config = {
gray400: "var(--gray400)",
gray500: "var(--gray500)",
purple100: "var(--purple100)",
white200: "var(--white200)",
},
screens: {
sm: "375px",
Expand Down
Loading