forked from deephaven/web-client-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStyleGuideRoot.tsx
More file actions
36 lines (32 loc) · 1.13 KB
/
StyleGuideRoot.tsx
File metadata and controls
36 lines (32 loc) · 1.13 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
import React, { useEffect } from 'react';
import { Provider } from 'react-redux';
import { FontBootstrap } from '@deephaven/components';
import '@deephaven/components/scss/BaseStyleSheet.scss';
import { MonacoUtils } from '@deephaven/console';
import { store } from '@deephaven/redux';
import { DownloadServiceWorkerUtils } from '@deephaven/iris-grid';
import MonacoWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker';
import StyleGuideInit from './StyleGuideInit';
export function StyleGuideRoot(): JSX.Element {
useEffect(function init() {
DownloadServiceWorkerUtils.register(
new URL(
`${import.meta.env.BASE_URL ?? ''}download/serviceWorker.js`,
window.location.href
)
);
MonacoUtils.init({ getWorker: () => new MonacoWorker() });
// disable annoying dnd-react warnings
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
window['__@hello-pangea/dnd-disable-dev-warnings'] = true;
}, []);
return (
<FontBootstrap>
<Provider store={store}>
<StyleGuideInit />
</Provider>
</FontBootstrap>
);
}
export default StyleGuideRoot;