Skip to content

Commit

Permalink
fix(toolbars): fall back to name if both title and icon are not speci…
Browse files Browse the repository at this point in the history
…fied
  • Loading branch information
huyenltnguyen committed Feb 6, 2022
1 parent 64c3190 commit 7cc7274
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions addons/toolbars/src/components/ToolbarMenuList.tsx
Expand Up @@ -38,6 +38,14 @@ export const ToolbarMenuList: FC<ToolbarMenuListProps> = 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(
Expand Down

0 comments on commit 7cc7274

Please sign in to comment.