diff options
Diffstat (limited to 'subprojects/frontend/src/editor/EditorArea.tsx')
-rw-r--r-- | subprojects/frontend/src/editor/EditorArea.tsx | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/subprojects/frontend/src/editor/EditorArea.tsx b/subprojects/frontend/src/editor/EditorArea.tsx index 915ec657..1c9b031b 100644 --- a/subprojects/frontend/src/editor/EditorArea.tsx +++ b/subprojects/frontend/src/editor/EditorArea.tsx | |||
@@ -1,17 +1,15 @@ | |||
1 | import Portal from '@mui/material/Portal'; | ||
2 | import { useTheme } from '@mui/material/styles'; | 1 | import { useTheme } from '@mui/material/styles'; |
3 | import { observer } from 'mobx-react-lite'; | 2 | import { observer } from 'mobx-react-lite'; |
4 | import React, { useCallback, useEffect } from 'react'; | 3 | import React, { useCallback, useEffect } from 'react'; |
5 | 4 | ||
6 | import { useRootStore } from '../RootStore'; | 5 | import type EditorStore from './EditorStore'; |
7 | |||
8 | import EditorTheme from './EditorTheme'; | 6 | import EditorTheme from './EditorTheme'; |
9 | import SearchToolbar from './SearchToolbar'; | ||
10 | 7 | ||
11 | function EditorArea(): JSX.Element { | 8 | function EditorArea({ |
12 | const { editorStore } = useRootStore(); | 9 | editorStore, |
13 | const { searchPanel: searchPanelStore } = editorStore; | 10 | }: { |
14 | const { element: searchPanelContainer } = searchPanelStore; | 11 | editorStore: EditorStore; |
12 | }): JSX.Element { | ||
15 | const { | 13 | const { |
16 | palette: { mode: paletteMode }, | 14 | palette: { mode: paletteMode }, |
17 | } = useTheme(); | 15 | } = useTheme(); |
@@ -32,13 +30,7 @@ function EditorArea(): JSX.Element { | |||
32 | <EditorTheme | 30 | <EditorTheme |
33 | showLineNumbers={editorStore.showLineNumbers} | 31 | showLineNumbers={editorStore.showLineNumbers} |
34 | ref={editorParentRef} | 32 | ref={editorParentRef} |
35 | > | 33 | /> |
36 | {searchPanelContainer !== undefined && ( | ||
37 | <Portal container={searchPanelContainer}> | ||
38 | <SearchToolbar store={searchPanelStore} /> | ||
39 | </Portal> | ||
40 | )} | ||
41 | </EditorTheme> | ||
42 | ); | 34 | ); |
43 | } | 35 | } |
44 | 36 | ||