This repository was archived by the owner on Jun 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathApp.tsx
More file actions
64 lines (59 loc) · 1.91 KB
/
App.tsx
File metadata and controls
64 lines (59 loc) · 1.91 KB
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
import algoliasearch from 'algoliasearch';
import { createStore, StoreProvider } from 'easy-peasy';
import { useRef } from 'react';
import Toast from './core/components/atoms/Toast';
import ToolTip from './core/components/atoms/Tooltip';
import ConfirmationModal from './core/components/containers/ConfirmationModal';
import KBarList from './core/components/containers/KBarList';
import EditorPane from './core/components/panes/EditorPane';
import NavigationPane from './core/components/panes/NavigationPane';
import WorkflowsPane from './core/components/panes/WorkflowsPane';
import './index.css';
import useWindowDimensions, { useStoreState } from './core/state/Hooks';
import Store from './core/state/Store';
export const store = createStore(Store);
export const inspectorWidth = 400;
export const searchClient = algoliasearch(
'U0RXNGRK45',
'798b0e1407310a2b54b566250592b3fd',
);
const Pinned = () => {
const tooltip = useStoreState((state) => state.tooltip);
return (
<div className="z-40 fixed">
{tooltip && (
<ToolTip target={tooltip.ref} facing={tooltip.facing}>
<p>{tooltip.description}</p>
</ToolTip>
)}
<Toast
className="p-6 fixed bottom-0 right-0 my-20"
style={{ width: inspectorWidth }}
/>
</div>
);
};
const App = () => {
const appWidth = useWindowDimensions();
const editorPane = useRef(null);
return (
<StoreProvider store={store}>
<Pinned />
<section className="flex flex-row h-full text-circle-black ">
<section
className="flex flex-col flex-nowrap flex-1"
style={{ width: appWidth.width - inspectorWidth }}
>
<WorkflowsPane />
<EditorPane />
</section>
<NavigationPane />
</section>
<div className="z-50">
<KBarList reference={editorPane} />
</div>
<ConfirmationModal />
</StoreProvider>
);
};
export default App;