From 7cc7274b2e7ba92828402a4e0993c911545e2e1c Mon Sep 17 00:00:00 2001 From: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com> Date: Sun, 6 Feb 2022 18:50:47 +0700 Subject: [PATCH] fix(toolbars): fall back to name if both title and icon are not specified --- addons/toolbars/src/components/ToolbarMenuList.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/toolbars/src/components/ToolbarMenuList.tsx b/addons/toolbars/src/components/ToolbarMenuList.tsx index 0f5bef8764fa..3887bdf86105 100644 --- a/addons/toolbars/src/components/ToolbarMenuList.tsx +++ b/addons/toolbars/src/components/ToolbarMenuList.tsx @@ -38,6 +38,14 @@ export const ToolbarMenuList: FC = withKeyboardCycle( // Deprecation support for old "name of global arg used as title" if (showName && !title) { title = name; + console.warn( + '`showName` is deprecated as `name` will stop having dual purposes in the future. Please specify a `title` in `globalTypes` instead.' + ); + } else if (!showName && !icon && !title) { + title = name; + console.warn( + `Using the \`name\` "${name}" as toolbar title for backward compatibility. \`name\` will stop having dual purposes in the future. Please specify either a \`title\` or an \`icon\` in \`globalTypes\` instead.` + ); } const handleItemClick = useCallback(