Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toolbars: Fall back to name if both title and icon are not specified #17430

Merged
merged 3 commits into from Jul 14, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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