From a39c8c2018f3e6f05df66dcdcec8bfeedb78eada Mon Sep 17 00:00:00 2001 From: lucas lelievre Date: Fri, 3 Nov 2023 14:33:05 -0700 Subject: [PATCH] Make button and typography children optional (#872) --- gui/src/components/commons/Button.tsx | 2 +- gui/src/components/commons/Typography.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gui/src/components/commons/Button.tsx b/gui/src/components/commons/Button.tsx index 7524c6f2a..2a054db04 100644 --- a/gui/src/components/commons/Button.tsx +++ b/gui/src/components/commons/Button.tsx @@ -47,7 +47,7 @@ export function Button({ rounded = false, ...props }: { - children: ReactNode; + children?: ReactNode; icon?: ReactNode; variant: 'primary' | 'secondary' | 'tertiary' | 'quaternary'; to?: string; diff --git a/gui/src/components/commons/Typography.tsx b/gui/src/components/commons/Typography.tsx index 2f8ae100e..5e115cc90 100644 --- a/gui/src/components/commons/Typography.tsx +++ b/gui/src/components/commons/Typography.tsx @@ -25,7 +25,7 @@ export function Typography({ | 'whitespace-pre' | 'whitespace-pre-line' | 'whitespace-pre-wrap'; - children: ReactNode; + children?: ReactNode; }) { const tag = useMemo(() => { const tags = { @@ -58,6 +58,6 @@ export function Typography({ italic && 'italic', ]), }, - children + children || [] ); }