From 4d14bb01249ed506beac1aac303ca26a57216a5b Mon Sep 17 00:00:00 2001 From: Luke <39926192+LukeWasTakenn@users.noreply.github.com> Date: Sat, 28 Oct 2023 18:51:09 +0200 Subject: [PATCH] feat(web/context): optional context menu title property Closes #428 --- .../menu/context/components/ContextButton.tsx | 40 ++++++++++--------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/web/src/features/menu/context/components/ContextButton.tsx b/web/src/features/menu/context/components/ContextButton.tsx index 9ea3eee..312ddf3 100644 --- a/web/src/features/menu/context/components/ContextButton.tsx +++ b/web/src/features/menu/context/components/ContextButton.tsx @@ -105,25 +105,27 @@ const ContextButton: React.FC<{ > - - {button?.icon && ( - - {typeof button.icon === 'string' && isIconUrl(button.icon) ? ( - Missing img - ) : ( - - )} - - )} - - {button.title || buttonKey} - - + {(button.title || Number.isNaN(+buttonKey)) && ( + + {button?.icon && ( + + {typeof button.icon === 'string' && isIconUrl(button.icon) ? ( + Missing img + ) : ( + + )} + + )} + + {button.title || buttonKey} + + + )} {button.description && ( {button.description}