Skip to content
Snippets Groups Projects
Unverified Commit ef7422f9 authored by Jack Reed's avatar Jack Reed Committed by GitHub
Browse files

Merge pull request #3144 from ProjectMirador/sidebar-buttons

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