Skip to content

Commit

Permalink
Merge pull request #145 from lunit-io/ds-100-button-startIcon-prop
Browse files Browse the repository at this point in the history
[DS-100] Button startIcon prop 활성화
  • Loading branch information
LTakhyunKim authored Nov 29, 2023
2 parents a623945 + ce99dbb commit 6179286
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/design-system/src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ const Button = forwardRef<HTMLButtonElement, ButtonProps>((props, ref) => {
icon,
className,
children,
startIcon,
...buttonProps
} = props;
const hasIconOnly = Boolean(icon && !children);
const hasIconOnly = Boolean((startIcon || icon) && !children);

return (
<>
Expand All @@ -26,7 +27,7 @@ const Button = forwardRef<HTMLButtonElement, ButtonProps>((props, ref) => {
kind="outlined"
color={props.color ?? "primary"}
size={size}
startIcon={icon}
startIcon={startIcon || icon}
hasIconOnly={hasIconOnly}
>
{!hasIconOnly && <>{children}</>}
Expand All @@ -41,7 +42,7 @@ const Button = forwardRef<HTMLButtonElement, ButtonProps>((props, ref) => {
kind={props.kind ?? "contained"}
color={props.color ?? "primary"}
size={size}
startIcon={icon}
startIcon={startIcon || icon}
hasIconOnly={hasIconOnly}
>
{!hasIconOnly && <>{children}</>}
Expand Down

0 comments on commit 6179286

Please sign in to comment.