Skip to content

Commit

Permalink
initial attempt to simplify code and ui
Browse files Browse the repository at this point in the history
  • Loading branch information
TZubiri committed Sep 24, 2019
1 parent 291b23a commit 6a5ebb3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 48 deletions.
49 changes: 4 additions & 45 deletions platform/viewer/src/connectedComponents/ConnectedPluginSwitch.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,59 +38,18 @@ const mergeProps = (propsFromState, propsFromDispatch, ownProps) => {

// TODO: Do not display certain options if the current display set
// cannot be displayed using these view types
const buttons = [
/*{
text: 'Acquired',
type: 'command',
icon: 'bars',
active: false,
onClick: () => {
console.warn('Original Acquisition');
const layoutData = setSingleLayoutData(
layout.viewports,
activeViewportIndex,
{ plugin: 'cornerstone' }
);
setLayout({ viewports: layoutData });
},
},
{
text: 'Axial',
icon: 'cube',
active: false,
onClick: () => {
commandsManager.runCommand('axial');
},
},
{
text: 'Sagittal',
icon: 'cube',
active: false,
onClick: () => {
commandsManager.runCommand('sagittal');
},
},
{
text: 'Coronal',
icon: 'cube',
active: false,
onClick: () => {
commandsManager.runCommand('coronal');
},
},*/
const button =
{
label: "2D MPR",
icon: "cube",
onClick: () => {
commandsManager.runCommand("mpr2d");
}
}
];
;

return {
buttons
button
};
};

Expand All @@ -100,4 +59,4 @@ const ConnectedPluginSwitch = connect(
mergeProps
)(PluginSwitch);

export default ConnectedPluginSwitch;
export default ConnectedPluginSwitch;
8 changes: 5 additions & 3 deletions platform/viewer/src/connectedComponents/PluginSwitch.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { ExpandableToolMenu } from '@ohif/ui';
import { ToolbarButton } from '@ohif/ui';
import './PluginSwitch.css';

class PluginSwitch extends Component {
static propTypes = {
buttons: PropTypes.array,
button: PropTypes.any,
};

static defaultProps = {};

render() {
return (
<div className="PluginSwitch">
<ExpandableToolMenu buttons={this.props.buttons} label={'View'} />
<ToolbarButton label = "2D MPR"
icon = "cube"
onClick = {this.props.button.onClick} />
</div>
);
}
Expand Down

0 comments on commit 6a5ebb3

Please sign in to comment.