forked from premieroctet/openchakra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
54 lines (49 loc) · 1.57 KB
/
App.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
import React from 'react'
import { Flex, Box } from '@chakra-ui/core'
import { DndProvider } from 'react-dnd'
import Backend from 'react-dnd-html5-backend'
import Editor from './components/editor/Editor'
import Inspector from './components/inspector/Inspector'
import Sidebar from './components/sidebar/Sidebar'
import Header from './components/Header'
import { Global } from '@emotion/core'
import { HotKeys } from 'react-hotkeys'
import useShortcuts, { keyMap } from './hooks/useShortcuts'
import EditorErrorBoundary from './components/errorBoundaries/EditorErrorBoundary'
import { InspectorProvider } from './contexts/inspector-context'
const App = () => {
const { handlers } = useShortcuts()
return (
<HotKeys allowChanges handlers={handlers} keyMap={keyMap}>
<Global
styles={() => ({
html: { minWidth: '860px', backgroundColor: '#1a202c' },
})}
/>
<Header />
<DndProvider backend={Backend}>
<Flex h="calc(100vh - 3rem)">
<Sidebar />
<EditorErrorBoundary>
<Box bg="white" flex={1} zIndex={10} position="relative">
<Editor />
</Box>
</EditorErrorBoundary>
<Box
maxH="calc(100vh - 3rem)"
flex="0 0 15rem"
bg="#f7fafc"
overflowY="auto"
overflowX="visible"
borderLeft="1px solid #cad5de"
>
<InspectorProvider>
<Inspector />
</InspectorProvider>
</Box>
</Flex>
</DndProvider>
</HotKeys>
)
}
export default App