Start adding toggle to open/close sidebar
This commit is contained in:
1 parent
4174018149
commit
c08d12cb36
7 files changed
+48
-26
No files matched your search
@@ -1,19 +1,25 @@
|
||||
import React, { Component } from "react";
|
||||
import PropTypes from "prop-types";
|
||||
import ConnectedToolbarSection from './ConnectedToolbarSection';
|
||||
import { RoundedButtonGroup } from 'react-viewerbase';
|
||||
import './ToolbarRow.css';
|
||||
|
||||
class ToolbarRow extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
}
|
||||
|
||||
render() {
|
||||
const leftSidebarToggle = [{
|
||||
value: 'studies',
|
||||
svgLink: '/icons.svg#icon-studies',
|
||||
svgWidth: 15,
|
||||
svgHeight: 13,
|
||||
bottomLabel: 'Series',
|
||||
onValueChanged: (value) => {
|
||||
console.log('value changed: ', value);
|
||||
}
|
||||
}];
|
||||
|
||||
return (<div className="ToolbarRow">
|
||||
<div className="clearfix">
|
||||
<div className="pull-left m-t-1">
|
||||
{/* > roundedButtonGroup leftSidebarToggleButtonData */}
|
||||
<RoundedButtonGroup options={leftSidebarToggle}/>
|
||||
</div>
|
||||
<ConnectedToolbarSection/>
|
||||
<div className="pull-right m-t-1 rm-x-1">
|
||||
@@ -25,8 +31,4 @@ class ToolbarRow extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
ToolbarRow.propTypes = {
|
||||
//studies: PropTypes.array
|
||||
};
|
||||
|
||||
export default ToolbarRow;
|
||||
@@ -73,8 +73,6 @@ class ViewerMain extends Component {
|
||||
this.setState({
|
||||
displaySets
|
||||
});
|
||||
|
||||
debugger;
|
||||
}
|
||||
|
||||
getCornerstoneViewport(data, index) {
|
||||
|
||||
@@ -2,12 +2,17 @@ import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { BrowserRouter } from 'react-router-dom';
|
||||
import { Provider } from 'react-redux';
|
||||
import { createStore } from 'redux';
|
||||
import { createStore, combineReducers } from 'redux';
|
||||
import App from './App.js';
|
||||
import OHIF from 'ohif-core';
|
||||
import './config';
|
||||
import ui from './redux/ui.js'
|
||||
|
||||
const store = createStore(OHIF.redux.combinedReducer);
|
||||
const reducers = OHIF.redux.reducers;
|
||||
reducers.ui = ui;
|
||||
|
||||
const combined = combineReducers(reducers)
|
||||
const store = createStore(combined);
|
||||
|
||||
const servers = {
|
||||
dicomWeb: [
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
const defaultState = {
|
||||
sidebarLeftOpen: true,
|
||||
sidebarRightOpen: true,
|
||||
}
|
||||
|
||||
const ui = (state = defaultState, action) => {
|
||||
switch (action.type) {
|
||||
case 'TOGGLE_LEFT_SIDEBAR':
|
||||
return Object.assign({}, state, { sidebarLeftOpen: !state.sidebarLeftOpen });
|
||||
case 'TOGGLE_RIGHT_SIDEBAR':
|
||||
return Object.assign({}, state, { sidebarRightOpen: !state.sidebarRightOpen });
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
};
|
||||
|
||||
export default ui;
|
||||
@@ -1 +1 @@
|
||||
export default 'e84197b19de7f434a322139752b306bf0ce847fa';
|
||||
export default '4174018149a2ccfece83df3b190ba9aeed548521';
|
||||
Reference in new issue
Block a user