From ea98e6d190bfa36560a4c33fa3ade32765512d0f Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Tue, 26 Nov 2024 13:55:40 +0100 Subject: [PATCH] UI/button: make children optional, fix layout shift --- pkgs/webview-ui/app/src/components/button/index.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/webview-ui/app/src/components/button/index.tsx b/pkgs/webview-ui/app/src/components/button/index.tsx index 8502e2e2e..b9ae956ed 100644 --- a/pkgs/webview-ui/app/src/components/button/index.tsx +++ b/pkgs/webview-ui/app/src/components/button/index.tsx @@ -39,7 +39,7 @@ const sizePaddings: Record = { interface ButtonProps extends JSX.ButtonHTMLAttributes { variant?: Variants; size?: Size; - children: JSX.Element; + children?: JSX.Element; startIcon?: JSX.Element; endIcon?: JSX.Element; class?: string; @@ -67,9 +67,9 @@ export const Button = (props: ButtonProps) => { )} {...other} > - {local.startIcon} - {local.children} - {local.endIcon} + {local.startIcon && {local.startIcon}} + {local.children && {local.children}} + {local.endIcon && {local.endIcon}} ); };