aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/frontend/src/editor/SearchPanelPortal.tsx
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2022-08-21 03:19:03 +0200
committerLibravatar Kristóf Marussy <kristof@marussy.com>2022-08-21 03:19:03 +0200
commit70dd02be202ae1b87ef8f7a2563ba09a3e7b0947 (patch)
treeddd34efea882a00e324000f84062c4cce28da814 /subprojects/frontend/src/editor/SearchPanelPortal.tsx
parentfeat(frontend): overlay window controls (diff)
downloadrefinery-70dd02be202ae1b87ef8f7a2563ba09a3e7b0947.tar.gz
refinery-70dd02be202ae1b87ef8f7a2563ba09a3e7b0947.tar.zst
refinery-70dd02be202ae1b87ef8f7a2563ba09a3e7b0947.zip
refactor(frontend): improve code splitting
Diffstat (limited to 'subprojects/frontend/src/editor/SearchPanelPortal.tsx')
-rw-r--r--subprojects/frontend/src/editor/SearchPanelPortal.tsx25
1 files changed, 25 insertions, 0 deletions
diff --git a/subprojects/frontend/src/editor/SearchPanelPortal.tsx b/subprojects/frontend/src/editor/SearchPanelPortal.tsx
new file mode 100644
index 00000000..e8301489
--- /dev/null
+++ b/subprojects/frontend/src/editor/SearchPanelPortal.tsx
@@ -0,0 +1,25 @@
1import Portal from '@mui/material/Portal';
2import { observer } from 'mobx-react-lite';
3import React from 'react';
4
5import type EditorStore from './EditorStore';
6import SearchToolbar from './SearchToolbar';
7
8function SearchPanelPortal({
9 editorStore: { searchPanel: searchPanelStore },
10}: {
11 editorStore: EditorStore;
12}): JSX.Element | null {
13 const { element: searchPanelContainer } = searchPanelStore;
14
15 if (searchPanelContainer === undefined) {
16 return null;
17 }
18 return (
19 <Portal container={searchPanelContainer}>
20 <SearchToolbar searchPanelStore={searchPanelStore} />
21 </Portal>
22 );
23}
24
25export default observer(SearchPanelPortal);