Skip to content
Snippets Groups Projects
Commit 31fba51d authored by Chris Beer's avatar Chris Beer
Browse files

Handle sidebar buttons within the tab component

parent c0dd7a2c
No related branches found
No related tags found
No related merge requests found
......@@ -22,14 +22,13 @@
</div>
);
const AddPluginComponentB = ({TabButton, PluginComponents, dispatch, ...otherProps}) => (
<TabButton id="add-plugin-companion-window-button" {...otherProps} label="P" value="pluginComponentA" />
const AddPluginComponentB = () => (
<span id="add-plugin-companion-window-button">Plugin</span>
);
AddPluginComponentB.value = 'pluginComponentA';
const addPluginA = {
target: 'CompanionWindowFactory',
companionWindowKey: 'pluginComponentA',
mode: 'add',
component: AddPluginComponentA,
};
......
......@@ -9,7 +9,6 @@ import AnnotationIcon from '@material-ui/icons/CommentSharp';
import AttributionIcon from '@material-ui/icons/CopyrightSharp';
import LayersIcon from '@material-ui/icons/LayersSharp';
import SearchIcon from '@material-ui/icons/SearchSharp';
import { PluginHook } from './PluginHook';
import CanvasIndexIcon from './icons/CanvasIndexIcon';
/**
*
......@@ -125,7 +124,15 @@ export class WindowSideBarButtons extends Component {
)}
/>
)}
<PluginHook TabButton={TabButton} PluginComponents={PluginComponents} />
{ PluginComponents
&& PluginComponents.map(PluginComponent => (
<TabButton
key={PluginComponent.value}
value={PluginComponent.value}
icon={<PluginComponent />}
/>
))
}
</Tabs>
);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment