From ce99dbb0996405d910547310bc1df95c8057f228 Mon Sep 17 00:00:00 2001 From: LTakhyunKim Date: Wed, 29 Nov 2023 15:16:30 +0900 Subject: [PATCH] fix(button): apply startIcon prop to Button --- packages/design-system/src/components/Button/Button.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/design-system/src/components/Button/Button.tsx b/packages/design-system/src/components/Button/Button.tsx index f6615d29..2216c957 100644 --- a/packages/design-system/src/components/Button/Button.tsx +++ b/packages/design-system/src/components/Button/Button.tsx @@ -11,9 +11,10 @@ const Button = forwardRef((props, ref) => { icon, className, children, + startIcon, ...buttonProps } = props; - const hasIconOnly = Boolean(icon && !children); + const hasIconOnly = Boolean((startIcon || icon) && !children); return ( <> @@ -26,7 +27,7 @@ const Button = forwardRef((props, ref) => { kind="outlined" color={props.color ?? "primary"} size={size} - startIcon={icon} + startIcon={startIcon || icon} hasIconOnly={hasIconOnly} > {!hasIconOnly && <>{children}} @@ -41,7 +42,7 @@ const Button = forwardRef((props, ref) => { kind={props.kind ?? "contained"} color={props.color ?? "primary"} size={size} - startIcon={icon} + startIcon={startIcon || icon} hasIconOnly={hasIconOnly} > {!hasIconOnly && <>{children}}