Small notes and typdef
This commit is contained in:
parent
3880b874ab
commit
7bcfaf02c0
@ -1,6 +1,11 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Nests React components as ordered in array. We use this to
|
||||||
|
* simplify composition a Mode specify's in it's configuration
|
||||||
|
* for React Contexts that should wrap a Mode Route.
|
||||||
|
*/
|
||||||
export default function Compose(props) {
|
export default function Compose(props) {
|
||||||
const { components = [], children } = props;
|
const { components = [], children } = props;
|
||||||
|
|
||||||
|
|||||||
@ -1,18 +1,13 @@
|
|||||||
import React, { useEffect, useCallback } from 'react';
|
import React from 'react';
|
||||||
import {
|
import PropTypes from 'prop-types';
|
||||||
displaySetManager,
|
//
|
||||||
ToolBarManager,
|
import { ToolbarLayoutProvider } from '@ohif/core';
|
||||||
useViewModel,
|
|
||||||
useToolbarLayout,
|
|
||||||
ToolbarLayoutProvider,
|
|
||||||
} from '@ohif/core';
|
|
||||||
import { DragAndDropProvider } from '@ohif/ui';
|
import { DragAndDropProvider } from '@ohif/ui';
|
||||||
//
|
//
|
||||||
import ViewportGrid from '@components/ViewportGrid';
|
import ViewportGrid from '@components/ViewportGrid';
|
||||||
import Compose from './Compose';
|
import Compose from './Compose';
|
||||||
import DisplaySetCreator from './DisplaySetCreator';
|
import DisplaySetCreator from './DisplaySetCreator';
|
||||||
|
|
||||||
|
|
||||||
export default function ModeRoute({
|
export default function ModeRoute({
|
||||||
location,
|
location,
|
||||||
mode,
|
mode,
|
||||||
@ -85,3 +80,17 @@ export default function ModeRoute({
|
|||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ModeRoute.propTypes = {
|
||||||
|
// Ref: https://reacttraining.com/react-router/web/api/location
|
||||||
|
location: PropTypes.shape({
|
||||||
|
key: PropTypes.string,
|
||||||
|
pathname: PropTypes.string.isRequired,
|
||||||
|
search: PropTypes.string.isRequired,
|
||||||
|
hash: PropTypes.string.isRequired,
|
||||||
|
state: PropTypes.object.isRequired,
|
||||||
|
}),
|
||||||
|
mode: PropTypes.object.isRequired,
|
||||||
|
dataSourceName: PropTypes.string,
|
||||||
|
extensionManager: PropTypes.object,
|
||||||
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user