Stop using children
This commit is contained in:
parent
488bb5d266
commit
1bb204b9a5
@ -28,12 +28,11 @@ function ViewerLayout({
|
|||||||
rightPanels,
|
rightPanels,
|
||||||
viewports,
|
viewports,
|
||||||
children,
|
children,
|
||||||
|
ViewportGridComp
|
||||||
}) {
|
}) {
|
||||||
const [displaySets, setDisplaySets] = useState({});
|
const [displaySets, setDisplaySets] = useState({});
|
||||||
|
|
||||||
const ViewportGrid = React.Children.only(children);
|
//const ViewportGrid = React.Children.only(children);
|
||||||
debugger;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set body classes (tailwindcss) that don't allow vertical
|
* Set body classes (tailwindcss) that don't allow vertical
|
||||||
@ -109,10 +108,10 @@ function ViewerLayout({
|
|||||||
<Toolbar type="secondary" tools={secondaryToolBarLayout.tools} />
|
<Toolbar type="secondary" tools={secondaryToolBarLayout.tools} />
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-1 h-full overflow-hidden bg-black items-center justify-center pb-2 pt-1">
|
<div className="flex flex-1 h-full overflow-hidden bg-black items-center justify-center pb-2 pt-1">
|
||||||
{/*<ViewportGrid
|
<ViewportGridComp
|
||||||
servicesManager={servicesManager}
|
servicesManager={servicesManager}
|
||||||
viewportComponents={viewportComponents}
|
viewportComponents={viewportComponents}
|
||||||
/>*/}
|
/>
|
||||||
{/*
|
{/*
|
||||||
viewportContents={[
|
viewportContents={[
|
||||||
<Viewport
|
<Viewport
|
||||||
|
|||||||
@ -1,13 +1,15 @@
|
|||||||
/**
|
/**
|
||||||
* CSS Grid Reference: http://grid.malven.co/
|
* CSS Grid Reference: http://grid.malven.co/
|
||||||
*/
|
*/
|
||||||
import React, { useState } from 'react';
|
import React, { useState, useCallback, useEffect } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { ViewportGrid, ViewportPane } from '@ohif/ui';
|
import { ViewportGrid, ViewportPane } from '@ohif/ui';
|
||||||
// import DefaultViewport from './DefaultViewport.js';
|
// import DefaultViewport from './DefaultViewport.js';
|
||||||
// import EmptyViewport from './EmptyViewport.js';
|
// import EmptyViewport from './EmptyViewport.js';
|
||||||
|
|
||||||
function ViewerViewportGrid(props) {
|
function ViewerViewportGrid(props) {
|
||||||
|
debugger;
|
||||||
|
|
||||||
const {
|
const {
|
||||||
activeViewportIndex,
|
activeViewportIndex,
|
||||||
servicesManager,
|
servicesManager,
|
||||||
@ -15,8 +17,6 @@ function ViewerViewportGrid(props) {
|
|||||||
dataSource,
|
dataSource,
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
debugger;
|
|
||||||
|
|
||||||
// TODO -> Need some way of selecting which displaySets hit the viewports.
|
// TODO -> Need some way of selecting which displaySets hit the viewports.
|
||||||
const { DisplaySetService } = servicesManager.services;
|
const { DisplaySetService } = servicesManager.services;
|
||||||
|
|
||||||
@ -50,7 +50,11 @@ function ViewerViewportGrid(props) {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// From ViewportGridService and/or ContextProvider
|
// From ViewportGridService and/or ContextProvider
|
||||||
const [viewportGrid, setViewportGrid] = useState({});
|
const [viewportGrid, setViewportGrid] = useState({
|
||||||
|
numCols: 1,
|
||||||
|
numRows: 1,
|
||||||
|
viewports: []
|
||||||
|
});
|
||||||
|
|
||||||
// viewportData --> displaySets
|
// viewportData --> displaySets
|
||||||
|
|
||||||
|
|||||||
@ -54,6 +54,7 @@ export default function ModeRoute({
|
|||||||
Compose({ components: contextModuleProviders, children });
|
Compose({ components: contextModuleProviders, children });
|
||||||
|
|
||||||
function ViewportGridWithDataSource(props) {
|
function ViewportGridWithDataSource(props) {
|
||||||
|
debugger;
|
||||||
return ViewportGrid({ ...props, dataSource });
|
return ViewportGrid({ ...props, dataSource });
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,9 +89,7 @@ export default function ModeRoute({
|
|||||||
* Use it from there instead of passing as a prop here.
|
* Use it from there instead of passing as a prop here.
|
||||||
*/}
|
*/}
|
||||||
<DragAndDropProvider>
|
<DragAndDropProvider>
|
||||||
<LayoutComponent {...layoutTemplateData.props}>
|
<LayoutComponent {...layoutTemplateData.props} ViewportGridComp={ViewportGridWithDataSource}/>
|
||||||
<div>test</div>
|
|
||||||
</LayoutComponent>
|
|
||||||
</DragAndDropProvider>
|
</DragAndDropProvider>
|
||||||
</CombinedContextProvider>
|
</CombinedContextProvider>
|
||||||
{/*</ToolbarLayoutProvider>*/}
|
{/*</ToolbarLayoutProvider>*/}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user