-
Notifications
You must be signed in to change notification settings - Fork 479
/
root-wrapper.tsx
30 lines (29 loc) · 1.12 KB
/
root-wrapper.tsx
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
import React from 'react';
import { Toaster } from 'react-hot-toast';
import { DarkModeProvider } from './src/context/DarkModeProvider';
import { EditorContext } from './src/context/EditorContext';
import { FirebaseProvider } from './src/context/FirebaseContext';
import GlobalErrorBoundary from './src/context/GlobalErrorBoundary';
import { SignInProvider } from './src/context/SignInContext';
import { UserDataProvider } from './src/context/UserDataContext/UserDataContext';
import { UserGroupsProvider } from './src/hooks/groups/useUserGroups';
export const wrapRootElement = ({ element }): JSX.Element => (
<>
<GlobalErrorBoundary>
<FirebaseProvider>
<UserDataProvider>
<DarkModeProvider>
<SignInProvider>
<UserGroupsProvider>
<EditorContext.Provider value={{ inEditor: false }}>
{element}
</EditorContext.Provider>
</UserGroupsProvider>
</SignInProvider>
</DarkModeProvider>
</UserDataProvider>
</FirebaseProvider>
</GlobalErrorBoundary>
<Toaster position="top-right" />
</>
);