1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00
unleash.unleash/frontend/src/index.tsx
Jaanus Sellin d770f624e6
refactor: move plausible context on top of feedback (#5824)
We were unable to send plausible events from feedback. Now we can.
2024-01-10 11:31:41 +02:00

55 lines
2.6 KiB
TypeScript

import 'whatwg-fetch';
import 'themes/app.css';
import 'regenerator-runtime/runtime';
import ReactDOM from 'react-dom';
import { BrowserRouter } from 'react-router-dom';
import { QueryParamProvider } from 'use-query-params';
import { ReactRouter6Adapter } from 'use-query-params/adapters/react-router-6';
import { ThemeProvider } from 'themes/ThemeProvider';
import { App } from 'component/App';
import { ScrollTop } from 'component/common/ScrollTop/ScrollTop';
import { AccessProvider } from 'component/providers/AccessProvider/AccessProvider';
import { basePath } from 'utils/formatPath';
import { FeedbackCESProvider } from 'component/feedback/FeedbackCESContext/FeedbackCESProvider';
import { AnnouncerProvider } from 'component/common/Announcer/AnnouncerProvider/AnnouncerProvider';
import { InstanceStatus } from 'component/common/InstanceStatus/InstanceStatus';
import { UIProviderContainer } from 'component/providers/UIProvider/UIProviderContainer';
import { StickyProvider } from 'component/common/Sticky/StickyProvider';
import { FeedbackProvider } from 'component/feedbackNew/FeedbackProvider';
import { PlausibleProvider } from 'component/providers/PlausibleProvider/PlausibleProvider';
import { Error as LayoutError } from './component/layout/Error/Error';
import { ErrorBoundary } from 'react-error-boundary';
window.global ||= window;
ReactDOM.render(
<UIProviderContainer>
<AccessProvider>
<BrowserRouter basename={basePath}>
<QueryParamProvider adapter={ReactRouter6Adapter}>
<ThemeProvider>
<AnnouncerProvider>
<ErrorBoundary FallbackComponent={LayoutError}>
<PlausibleProvider>
<FeedbackProvider>
<FeedbackCESProvider>
<StickyProvider>
<InstanceStatus>
<ScrollTop />
<App />
</InstanceStatus>
</StickyProvider>
</FeedbackCESProvider>
</FeedbackProvider>
</PlausibleProvider>
</ErrorBoundary>
</AnnouncerProvider>
</ThemeProvider>
</QueryParamProvider>
</BrowserRouter>
</AccessProvider>
</UIProviderContainer>,
document.getElementById('app'),
);