-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
index.tsx
57 lines (52 loc) · 1.97 KB
/
index.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
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
import type { ReactNode } from 'react';
import { LIVEPEER_KEY } from '@hey/data/constants';
import { apolloClient, ApolloProvider } from '@hey/lens/apollo';
import authLink from '@lib/authLink';
import getLivepeerTheme from '@lib/getLivepeerTheme';
import {
createReactClient,
LivepeerConfig,
studioProvider
} from '@livepeer/react';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { ThemeProvider } from 'next-themes';
import ErrorBoundary from '../ErrorBoundary';
import Layout from '../Layout';
import CrispProvider from './CrispProvider';
import LeafwatchProvider from './LeafwatchProvider';
import LensSubscriptionsProvider from './LensSubscriptionsProvider';
import OptimisticTransactionsProvider from './OptimisticTransactionsProvider';
import PreferencesProvider from './PreferencesProvider';
import ServiceWorkerProvider from './ServiceWorkerProvider';
import Web3Provider from './Web3Provider';
const lensApolloClient = apolloClient(authLink);
const livepeerClient = createReactClient({
provider: studioProvider({ apiKey: LIVEPEER_KEY })
});
const queryClient = new QueryClient({
defaultOptions: { queries: { refetchOnWindowFocus: false } }
});
const Providers = ({ children }: { children: ReactNode }) => {
return (
<ErrorBoundary>
<CrispProvider />
<ServiceWorkerProvider />
<LeafwatchProvider />
<Web3Provider>
<ApolloProvider client={lensApolloClient}>
<LensSubscriptionsProvider />
<OptimisticTransactionsProvider />
<QueryClientProvider client={queryClient}>
<PreferencesProvider />
<LivepeerConfig client={livepeerClient} theme={getLivepeerTheme}>
<ThemeProvider attribute="class" defaultTheme="light">
<Layout>{children}</Layout>
</ThemeProvider>
</LivepeerConfig>
</QueryClientProvider>
</ApolloProvider>
</Web3Provider>
</ErrorBoundary>
);
};
export default Providers;