2018-12-18 14:15:55 +01:00
|
|
|
import React, { Component } from "react";
|
|
|
|
|
import ConnectedToolbarSection from './ConnectedToolbarSection';
|
2019-01-06 21:59:25 +01:00
|
|
|
import ConnectedLayoutButton from './ConnectedLayoutButton';
|
2018-12-19 14:53:03 +01:00
|
|
|
import PropTypes from 'prop-types';
|
2018-12-19 09:41:30 +01:00
|
|
|
import { RoundedButtonGroup } from 'react-viewerbase';
|
2018-12-18 14:15:55 +01:00
|
|
|
import './ToolbarRow.css';
|
|
|
|
|
|
|
|
|
|
class ToolbarRow extends Component {
|
2018-12-19 14:53:03 +01:00
|
|
|
static propTypes = {
|
|
|
|
|
leftSidebarOpen: PropTypes.bool.isRequired,
|
|
|
|
|
rightSidebarOpen: PropTypes.bool.isRequired,
|
|
|
|
|
setLeftSidebarOpen: PropTypes.func,
|
|
|
|
|
setRightSidebarOpen: PropTypes.func
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static defaultProps = {
|
|
|
|
|
leftSidebarOpen: false,
|
|
|
|
|
rightSidebarOpen: false
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
onLeftSidebarValueChanged = (value) => {
|
|
|
|
|
this.props.setLeftSidebarOpen(!!value);
|
|
|
|
|
|
|
|
|
|
console.log('value changed: ', value);
|
|
|
|
|
}
|
|
|
|
|
|
2018-12-18 14:15:55 +01:00
|
|
|
render() {
|
2018-12-19 09:41:30 +01:00
|
|
|
const leftSidebarToggle = [{
|
|
|
|
|
value: 'studies',
|
|
|
|
|
svgLink: '/icons.svg#icon-studies',
|
|
|
|
|
svgWidth: 15,
|
|
|
|
|
svgHeight: 13,
|
|
|
|
|
bottomLabel: 'Series',
|
|
|
|
|
}];
|
|
|
|
|
|
2018-12-19 14:53:03 +01:00
|
|
|
const leftSidebarValue = this.props.leftSidebarOpen ? leftSidebarToggle[0].value : null;
|
|
|
|
|
|
2018-12-18 14:15:55 +01:00
|
|
|
return (<div className="ToolbarRow">
|
2019-01-06 21:59:25 +01:00
|
|
|
<div className="pull-left m-t-1 p-y-1" style={{ padding: '10px' }}>
|
|
|
|
|
<RoundedButtonGroup options={leftSidebarToggle} value={leftSidebarValue} onValueChanged={this.onLeftSidebarValueChanged}/>
|
|
|
|
|
</div>
|
|
|
|
|
<ConnectedToolbarSection/>
|
|
|
|
|
<ConnectedLayoutButton/>
|
|
|
|
|
<div className="pull-right m-t-1 rm-x-1">
|
|
|
|
|
{/* > roundedButtonGroup rightSidebarToggleButtonData */}
|
2018-12-18 14:15:55 +01:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default ToolbarRow;
|