You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

editor.tsx 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import useKeyboardEvents from 'hooks/useKeyboardEvents'
  2. import useLoadOnMount from 'hooks/useLoadOnMount'
  3. import Canvas from './canvas/canvas'
  4. import StatusBar from './status-bar'
  5. import ToolsPanel from './tools-panel/tools-panel'
  6. import StylePanel from './style-panel/style-panel'
  7. import styled from 'styles'
  8. import PagePanel from './page-panel/page-panel'
  9. import CodePanel from './code-panel/code-panel'
  10. export default function Editor(): JSX.Element {
  11. useKeyboardEvents()
  12. useLoadOnMount()
  13. return (
  14. <Layout>
  15. <CodePanel />
  16. <PagePanel />
  17. <Spacer />
  18. <StylePanel />
  19. <Canvas />
  20. <ToolsPanel />
  21. <StatusBar />
  22. </Layout>
  23. )
  24. }
  25. const Spacer = styled('div', {
  26. flexGrow: 2,
  27. })
  28. const Layout = styled('main', {
  29. position: 'fixed',
  30. overflow: 'hidden',
  31. top: 0,
  32. left: 0,
  33. bottom: 0,
  34. right: 0,
  35. height: '100%',
  36. width: '100%',
  37. padding: '8px 8px 0 8px',
  38. zIndex: 200,
  39. display: 'flex',
  40. alignItems: 'flex-start',
  41. justifyContent: 'flex-start',
  42. pointerEvents: 'none',
  43. '& > *': {
  44. PointerEvent: 'all',
  45. },
  46. })