remove "Toolbar" and ViewportToolbar from @ohif/ui

Unecessary wrappers for displaying ToolbarButtons
This commit is contained in:
dannyrb committed 2020-06-14 21:57:45 -04:00
1 parent 38203c9b31
commit 3cec88b552
9 files changed
+16 -334

No files matched your search

+5 -12
View File
@@ -1,14 +1,7 @@
import React from 'react';
import {
SidePanel,
StudyBrowser,
DragAndDropProvider,
ViewportGrid,
ViewportPane,
} from '@ohif/ui';
import { SidePanel, StudyBrowser, DragAndDropProvider } from '@ohif/ui';
import Header from './components/Header';
import ViewportToolbar from './components/ViewportToolBar';
const Viewer = () => {
return (
@@ -16,7 +9,7 @@ const Viewer = () => {
<div>
<Header />
<div
className="flex flex-row flex-no-wrap flex-1 items-stretch overflow-hidden w-full"
className="flex flex-row flex-no-wrap items-stretch flex-1 w-full overflow-hidden"
style={{ height: 'calc(100vh - 57px' }}
>
<SidePanel
@@ -28,8 +21,8 @@ const Viewer = () => {
>
<StudyBrowser />
</SidePanel>
<div className="flex flex-1 h-100 overflow-hidden bg-primary-main items-center justify-center text-white">
<ViewportToolbar />
<div className="flex items-center justify-center flex-1 overflow-hidden text-white h-100 bg-primary-main">
{/* <ViewportToolbar /> */}
<div>CONTENT</div>
</div>
<SidePanel
@@ -39,7 +32,7 @@ const Viewer = () => {
componentLabel="Measurements"
defaultIsOpen={false}
>
<div className="flex justify-center text-white p-2">
<div className="flex justify-center p-2 text-white">
panel placeholder
</div>
</SidePanel>
+1 -2
View File
@@ -25,7 +25,6 @@ import {
} from '@ohif/ui';
import Header from './components/Header';
import ViewportToolbar from './components/ViewportToolBar';
import { tabs } from './studyBrowserMockData';
@@ -76,7 +75,7 @@ import { tabs } from './studyBrowserMockData';
{/* TOOLBAR + GRID */}
<div className="flex flex-col flex-1 h-full">
<div className="flex flex-2 w-100 border-b border-transparent h-12">
<ViewportToolbar />
{/* <ViewportToolbar /> Secondary Toolbar */}
</div>
{/* VIEWPORT GRID CONTAINER */}
<div className="flex flex-1 h-full overflow-hidden bg-black items-center justify-center pb-2 pt-1">
@@ -1,5 +1,5 @@
import React, { useState } from 'react';
import { NavBar, Svg, Icon, IconButton, Toolbar } from '@ohif/ui';
import { NavBar, Svg, Icon, IconButton } from '@ohif/ui';
const Header = () => {
const [activeTool, setActiveTool] = useState('Zoom');
@@ -34,15 +34,15 @@ const Header = () => {
{dropdownContent.map((row, i) => (
<div
key={i}
className="flex justify-between py-2 px-3 hover:bg-secondary-dark cursor-pointer"
className="flex justify-between px-3 py-2 cursor-pointer hover:bg-secondary-dark"
>
<div>
<span className="text-base text-white">{row.name}</span>
<span className="text-base text-primary-light ml-3">
<span className="ml-3 text-base text-primary-light">
{row.value}
</span>
</div>
<span className="text-base text-primary-active ml-4">{i}</span>
<span className="ml-4 text-base text-primary-active">{i}</span>
</div>
))}
</div>
@@ -75,12 +75,12 @@ const Header = () => {
];
return (
<NavBar className="justify-between border-b-4 border-black">
<div className="flex flex-1 justify-between">
<div className="flex justify-between flex-1">
<div className="flex items-center">
<div className="mr-3 inline-flex items-center">
<div className="inline-flex items-center mr-3">
<Icon
name="chevron-left"
className="text-primary-active w-8 cursor-pointer"
className="w-8 cursor-pointer text-primary-active"
onClick={() => alert('Navigate to previous page')}
/>
<a href="#" className="ml-4">
@@ -89,10 +89,10 @@ const Header = () => {
</div>
</div>
<div className="flex items-center">
<Toolbar tools={tools} activeTool={activeTool} moreTools={tools} />
{/* <Toolbar tools={tools} activeTool={activeTool} moreTools={tools} /> */}
</div>
<div className="flex items-center">
<span className="mr-3 text-common-light text-lg">
<span className="mr-3 text-lg text-common-light">
FOR INVESTIGATIONAL USE ONLY
</span>
<IconButton
@@ -1,47 +0,0 @@
import React from 'react';
import { Toolbar } from '@ohif/ui';
const ViewportToolbar = () => {
const tools = [
{
id: 'Annotate',
label: 'Annotate',
icon: 'tool-annotate',
type: null,
commandName: 'setToolActive',
commandOptions: { toolName: 'Annotate' },
onClick: () => console.log('Activate Annotate'),
},
{
id: 'Bidirectional',
label: 'Bidirectional',
icon: 'tool-bidirectional',
type: null,
commandName: 'setToolActive',
commandOptions: { toolName: 'Bidirectional' },
onClick: () => console.log('Activate Bidirectional'),
},
{
id: 'Elipse',
label: 'Elipse',
icon: 'tool-elipse',
type: null,
commandName: 'setToolActive',
commandOptions: { toolName: 'Elipse' },
onClick: () => console.log('Activate Elipse'),
},
{
id: 'Length',
label: 'Length',
icon: 'tool-length',
type: null,
commandName: 'setToolActive',
commandOptions: { toolName: 'Length' },
onClick: () => console.log('Activate Length'),
},
];
return <Toolbar type="secondary" tools={tools} />;
};
export default ViewportToolbar;