Skip to content

Commit

Permalink
fix: fall back to name if both title and icon are not specified
Browse files Browse the repository at this point in the history
  • Loading branch information
huyenltnguyen committed Feb 6, 2022
1 parent 64c3190 commit 3d03ed6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions addons/toolbars/src/components/ToolbarMenuList.tsx
Expand Up @@ -38,6 +38,16 @@ 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.'
);
}

if (!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 3d03ed6

Please sign in to comment.