-
Notifications
You must be signed in to change notification settings - Fork 175
/
ProtocolEditor.tsx
69 lines (64 loc) · 2.36 KB
/
ProtocolEditor.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import * as React from 'react'
import cx from 'classnames'
import { DragDropContext } from 'react-dnd'
import MouseBackEnd from 'react-dnd-mouse-backend'
import { ComputingSpinner } from '../components/ComputingSpinner'
import { ConnectedNav } from '../containers/ConnectedNav'
import { ConnectedSidebar } from '../containers/ConnectedSidebar'
import { ConnectedTitleBar } from '../containers/ConnectedTitleBar'
import { ConnectedMainPanel } from '../containers/ConnectedMainPanel'
import { PortalRoot as MainPageModalPortalRoot } from '../components/portals/MainPageModalPortal'
import { MAIN_CONTENT_FORCED_SCROLL_CLASSNAME } from '../ui/steps/utils'
import { PrereleaseModeIndicator } from './PrereleaseModeIndicator'
import { PortalRoot as TopPortalRoot } from './portals/TopPortal'
import { NewFileModal } from './modals/NewFileModal'
import { FileUploadMessageModal } from './modals/FileUploadMessageModal'
import { LabwareUploadMessageModal } from './modals/LabwareUploadMessageModal'
import { GateModal } from './modals/GateModal'
import { AnnouncementModal } from './modals/AnnouncementModal'
import styles from './ProtocolEditor.css'
const showGateModal =
process.env.NODE_ENV === 'production' || process.env.OT_PD_SHOW_GATE
export interface Props {
children?: React.ReactNode
}
function ProtocolEditorComponent(props: Props): JSX.Element {
return (
<div>
<ComputingSpinner />
<TopPortalRoot />
{showGateModal ? <GateModal /> : null}
<PrereleaseModeIndicator />
<div className={styles.wrapper}>
<ConnectedNav />
<ConnectedSidebar />
<div className={styles.main_page_wrapper}>
<ConnectedTitleBar />
<div
id="main-page"
className={cx(
styles.main_page_content,
MAIN_CONTENT_FORCED_SCROLL_CLASSNAME
)}
>
<AnnouncementModal />
{props.children ? (
props.children
) : (
<>
<NewFileModal showProtocolFields />
<FileUploadMessageModal />
<MainPageModalPortalRoot />
<LabwareUploadMessageModal />
<ConnectedMainPanel />
</>
)}
</div>
</div>
</div>
</div>
)
}
export const ProtocolEditor = DragDropContext(MouseBackEnd)(
ProtocolEditorComponent
)