chore: Refactors towards shared menu component (#4445)

This commit is contained in:
Tom Moor
2022-11-19 13:15:38 -08:00
committed by GitHub
parent 924b554281
commit ae6855f3df
21 changed files with 186 additions and 194 deletions

View File

@@ -30,7 +30,6 @@ function ToolbarMenu(props: Props) {
if (item.visible === false || !item.icon) {
return null;
}
const Icon = item.icon;
const isActive = item.active ? item.active(state) : false;
return (
@@ -39,7 +38,7 @@ function ToolbarMenu(props: Props) {
onClick={() => item.name && commands[item.name](item.attrs)}
active={isActive}
>
<Icon color="currentColor" />
{React.cloneElement(item.icon, { color: "currentColor" })}
</ToolbarButton>
</Tooltip>
);