* fix: 🐛 Update ohif pdf extension to optionally use pdfjs Update ohif pdf extension of optionally use pdfjs Closes: #1049 * Update branch and fix scrolling * Dynamically import component * Fix wrong file change * Fix import * Add multi opened pdf configuration * Refactor connected component * Specify worker explicitly * Specify worker explicitly * CR Update: Remove dead code * CR Update: Refactor state * CR Update: use refs * CR Update: use refs
28 lines
672 B
JavaScript
28 lines
672 B
JavaScript
import OHIF from '@ohif/core';
|
|
import { connect } from 'react-redux';
|
|
import OHIFDicomPDFViewport from './OHIFDicomPDFViewport';
|
|
|
|
const { setViewportActive } = OHIF.redux.actions;
|
|
|
|
const mapStateToProps = (state, ownProps) => {
|
|
const { activeViewportIndex } = state.viewports;
|
|
return { activeViewportIndex };
|
|
};
|
|
|
|
const mapDispatchToProps = (dispatch, ownProps) => {
|
|
const { viewportIndex } = ownProps;
|
|
|
|
return {
|
|
setViewportActive: () => {
|
|
dispatch(setViewportActive(viewportIndex));
|
|
},
|
|
};
|
|
};
|
|
|
|
const ConnectedOHIFDicomPDFViewer = connect(
|
|
mapStateToProps,
|
|
mapDispatchToProps
|
|
)(OHIFDicomPDFViewport);
|
|
|
|
export default ConnectedOHIFDicomPDFViewer;
|