* Organize viewports reducers * Organize viewports actions * Add local state to store dom node and remove hack * Comment usage of dom in vtk * Fix set of enabledElements * Fix warning in html viewport * Update docs for state * Add commandsmanager to commandsmodule
34 lines
752 B
JavaScript
34 lines
752 B
JavaScript
import OHIF from '@ohif/core';
|
|
import { connect } from 'react-redux';
|
|
import DicomHtmlViewport from './DicomHtmlViewport';
|
|
|
|
const { setViewportActive } = OHIF.redux.actions;
|
|
|
|
const mapStateToProps = (state, ownProps) => {
|
|
const { viewportIndex, byteArray } = ownProps;
|
|
const { activeViewportIndex } = state.viewports;
|
|
|
|
return {
|
|
viewportIndex,
|
|
activeViewportIndex,
|
|
byteArray,
|
|
};
|
|
};
|
|
|
|
const mapDispatchToProps = (dispatch, ownProps) => {
|
|
const { viewportIndex } = ownProps;
|
|
|
|
return {
|
|
setViewportActive: () => {
|
|
dispatch(setViewportActive(viewportIndex));
|
|
},
|
|
};
|
|
};
|
|
|
|
const ConnectedDicomHtmlViewport = connect(
|
|
mapStateToProps,
|
|
mapDispatchToProps
|
|
)(DicomHtmlViewport);
|
|
|
|
export default ConnectedDicomHtmlViewport;
|