Pull config from window for now
This commit is contained in:
1 parent
94e45b1b65
commit
7f52bade3e
4 files changed
+100
-100
No files matched your search
@@ -1,12 +1,12 @@
|
||||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import OHIF from 'ohif-core';
|
||||
import { RoundedButtonGroup } from 'react-viewerbase';
|
||||
import ConnectedLayoutButton from './ConnectedLayoutButton';
|
||||
import ConnectedPluginSwitch from './ConnectedPluginSwitch.js';
|
||||
import './ToolbarRow.css';
|
||||
import React, { Component } from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import OHIF from 'ohif-core'
|
||||
import { RoundedButtonGroup } from 'react-viewerbase'
|
||||
import ConnectedLayoutButton from './ConnectedLayoutButton'
|
||||
import ConnectedPluginSwitch from './ConnectedPluginSwitch.js'
|
||||
import './ToolbarRow.css'
|
||||
|
||||
const Icons = 'icons.svg';
|
||||
const Icons = `${window.config.routerBasenameicons}icons.svg`
|
||||
|
||||
class ToolbarRow extends Component {
|
||||
static propTypes = {
|
||||
@@ -14,21 +14,21 @@ class ToolbarRow extends Component {
|
||||
rightSidebarOpen: PropTypes.bool.isRequired,
|
||||
setLeftSidebarOpen: PropTypes.func,
|
||||
setRightSidebarOpen: PropTypes.func,
|
||||
pluginId: PropTypes.string
|
||||
};
|
||||
pluginId: PropTypes.string,
|
||||
}
|
||||
|
||||
static defaultProps = {
|
||||
leftSidebarOpen: false,
|
||||
rightSidebarOpen: false
|
||||
};
|
||||
rightSidebarOpen: false,
|
||||
}
|
||||
|
||||
onLeftSidebarValueChanged = value => {
|
||||
this.props.setLeftSidebarOpen(!!value);
|
||||
};
|
||||
this.props.setLeftSidebarOpen(!!value)
|
||||
}
|
||||
|
||||
onRightSidebarValueChanged = value => {
|
||||
this.props.setRightSidebarOpen(!!value);
|
||||
};
|
||||
this.props.setRightSidebarOpen(!!value)
|
||||
}
|
||||
|
||||
render() {
|
||||
const leftSidebarToggle = [
|
||||
@@ -37,9 +37,9 @@ class ToolbarRow extends Component {
|
||||
svgLink: `${Icons}#icon-studies`,
|
||||
svgWidth: 15,
|
||||
svgHeight: 13,
|
||||
bottomLabel: 'Series'
|
||||
}
|
||||
];
|
||||
bottomLabel: 'Series',
|
||||
},
|
||||
]
|
||||
|
||||
const rightSidebarToggle = [
|
||||
{
|
||||
@@ -47,32 +47,30 @@ class ToolbarRow extends Component {
|
||||
svgLink: `${Icons}#icon-measurements-lesions`,
|
||||
svgWidth: 15,
|
||||
svgHeight: 13,
|
||||
bottomLabel: 'Measurements'
|
||||
}
|
||||
];
|
||||
bottomLabel: 'Measurements',
|
||||
},
|
||||
]
|
||||
|
||||
const leftSidebarValue = this.props.leftSidebarOpen
|
||||
? leftSidebarToggle[0].value
|
||||
: null;
|
||||
: null
|
||||
|
||||
const rightSidebarValue = this.props.rightSidebarOpen
|
||||
? rightSidebarToggle[0].value
|
||||
: null;
|
||||
: null
|
||||
|
||||
const currentPluginId = this.props.pluginId;
|
||||
const currentPluginId = this.props.pluginId
|
||||
|
||||
const { PLUGIN_TYPES, availablePlugins } = OHIF.plugins;
|
||||
const { PLUGIN_TYPES, availablePlugins } = OHIF.plugins
|
||||
const plugin = availablePlugins.find(entry => {
|
||||
return (
|
||||
entry.type === PLUGIN_TYPES.TOOLBAR && entry.id === currentPluginId
|
||||
);
|
||||
});
|
||||
return entry.type === PLUGIN_TYPES.TOOLBAR && entry.id === currentPluginId
|
||||
})
|
||||
|
||||
let pluginComp;
|
||||
let pluginComp
|
||||
if (plugin) {
|
||||
const PluginComponent = plugin.component;
|
||||
const PluginComponent = plugin.component
|
||||
|
||||
pluginComp = <PluginComponent />;
|
||||
pluginComp = <PluginComponent />
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -95,8 +93,8 @@ class ToolbarRow extends Component {
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default ToolbarRow;
|
||||
export default ToolbarRow
|
||||
Reference in new issue
Block a user