Start adding toggle to open/close sidebar
This commit is contained in:
parent
4174018149
commit
c08d12cb36
@ -13,7 +13,7 @@
|
||||
"hammerjs": "^2.0.8",
|
||||
"lodash.debounce": "^4.0.8",
|
||||
"moment": "^2.22.2",
|
||||
"ohif-core": "^0.1.0",
|
||||
"ohif-core": "^0.1.1",
|
||||
"prop-types": "^15.6.2",
|
||||
"query-string": "^6.2.0",
|
||||
"react": "^16.4.1",
|
||||
@ -23,7 +23,7 @@
|
||||
"react-router": "^4.3.1",
|
||||
"react-router-dom": "^4.3.1",
|
||||
"react-scripts": "^2.1.1",
|
||||
"react-viewerbase": "^0.1.2",
|
||||
"react-viewerbase": "^0.1.4",
|
||||
"redux": "^4.0.1"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
@ -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: [
|
||||
|
||||
17
OHIFViewer-react/src/redux/ui.js
Normal file
17
OHIFViewer-react/src/redux/ui.js
Normal file
@ -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';
|
||||
|
||||
@ -6832,10 +6832,10 @@ obuf@^1.0.0, obuf@^1.1.1:
|
||||
resolved "https://registry.yarnpkg.com/obuf/-/obuf-1.1.2.tgz#09bea3343d41859ebd446292d11c9d4db619084e"
|
||||
integrity sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==
|
||||
|
||||
ohif-core@^0.1.0:
|
||||
version "0.1.0"
|
||||
resolved "https://registry.yarnpkg.com/ohif-core/-/ohif-core-0.1.0.tgz#5de7a7e51abb3c895ed1479cf4b607f1f162cf8a"
|
||||
integrity sha512-4jICzpSTM8Nfq8rY1JjKk/hWRGLWO3eq154PGX8fqYcQuTx8DxDlQLlKQoKbgRqNH2LBGBtOfDWjCZaBp7cDfg==
|
||||
ohif-core@^0.1.1:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/ohif-core/-/ohif-core-0.1.1.tgz#594b5a7969c11e5d5eaa3890a384f39409543d3b"
|
||||
integrity sha512-Ib/lI9fioMiqt5DXmZ8iXtiSne8Z2ubQoh/ePAwgZPljXfMvSY1cUpQK+O90pZqBh444KDolYX00OrJIIbSRgg==
|
||||
dependencies:
|
||||
cornerstone-math "^0.1.7"
|
||||
isomorphic-base64 "^1.0.2"
|
||||
@ -8288,10 +8288,10 @@ react-scripts@^2.1.1:
|
||||
optionalDependencies:
|
||||
fsevents "1.2.4"
|
||||
|
||||
react-viewerbase@^0.1.2:
|
||||
version "0.1.3"
|
||||
resolved "https://registry.yarnpkg.com/react-viewerbase/-/react-viewerbase-0.1.3.tgz#0a1861149ef5d8116e68f2d375147edf942ce1aa"
|
||||
integrity sha512-xuMTxgXa+E3lXLeI7mn8MVSiVw8C+HwjYbxItMues5cmeRrUvpjZ0VVx8Qcvr/9XwDmKShHj4mdyKhLL0koi/Q==
|
||||
react-viewerbase@^0.1.4:
|
||||
version "0.1.4"
|
||||
resolved "https://registry.yarnpkg.com/react-viewerbase/-/react-viewerbase-0.1.4.tgz#3df7c35e3af3cc1b1a42a8d295ab28bb086efca3"
|
||||
integrity sha512-uj5AMJ9gdHxSJ8JmNVOS3ri9RdVhCAUFf2OX0u5qJ20vpkp3gUHE9ENjZdjYEQ8222g7jhB4d3EM1Jd8wALYNA==
|
||||
dependencies:
|
||||
classnames "^2.2.6"
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user