@@ -47,10 +47,12 @@ export function ExtensionToolbarItem({ compact }: Props) {
|
||||
isOpen={isActive}
|
||||
title={component.title}
|
||||
onClick={() => {
|
||||
const event = isActive
|
||||
? new CloseExtensionSidebarEvent()
|
||||
: new OpenExtensionSidebarEvent({ pluginId, componentTitle: component.title });
|
||||
getAppEvents().publish(event);
|
||||
const appEvents = getAppEvents();
|
||||
if (isActive) {
|
||||
appEvents.publish(new CloseExtensionSidebarEvent());
|
||||
} else {
|
||||
appEvents.publish(new OpenExtensionSidebarEvent({ pluginId, componentTitle: component.title }));
|
||||
}
|
||||
}}
|
||||
pluginId={pluginId}
|
||||
/>
|
||||
@@ -68,11 +70,12 @@ export function ExtensionToolbarItem({ compact }: Props) {
|
||||
active={dockedComponentId === id}
|
||||
label={c.title}
|
||||
onClick={() => {
|
||||
const event =
|
||||
dockedComponentId === id
|
||||
? new CloseExtensionSidebarEvent()
|
||||
: new OpenExtensionSidebarEvent({ pluginId, componentTitle: c.title });
|
||||
getAppEvents().publish(event);
|
||||
const appEvents = getAppEvents();
|
||||
if (dockedComponentId === id) {
|
||||
appEvents.publish(new CloseExtensionSidebarEvent());
|
||||
} else {
|
||||
appEvents.publish(new OpenExtensionSidebarEvent({ pluginId, componentTitle: c.title }));
|
||||
}
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user