Skip to content

Commit

Permalink
(#0) Button Disabled 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
baegofda committed Dec 9, 2023
1 parent de7a0a0 commit 6b4a10b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/core/components/Button/Button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ const meta = {
control: "boolean",
description: "Button With Underline",
},
disabled: {
control: "boolean",
description: "Button With disabled",
},
},
} satisfies Meta<typeof Button>;

Expand Down
6 changes: 4 additions & 2 deletions src/core/components/Button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const Button = forwardRef(({
content,
rightIcon,
hasUnderline = false,
disabled,
...props
}: ButtonProps,
ref: React.Ref<HTMLButtonElement>,
Expand All @@ -29,7 +30,7 @@ ref: React.Ref<HTMLButtonElement>,
ref = {ref}
type = {"button"}
className = {clsx(
"flex items-center justify-center",
"flex items-center justify-center disabled:cursor-not-allowed disabled:text-white disabled:bg-gray-03 disabled:border-gray-03",
`text-${theme}`,
`text-${color}`,
`bg-${backgroundColor}`,
Expand All @@ -38,7 +39,8 @@ ref: React.Ref<HTMLButtonElement>,
BUTTON_ROUNDED[rounded],
borderColor && `border border-${borderColor}`,
className,
)}
)}
disabled = {disabled}
{...rest}
>
{leftIcon && <div>{leftIcon}</div>}
Expand Down

0 comments on commit 6b4a10b

Please sign in to comment.