forked from pooltogether/pooltogether.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAppContainer.tsx
35 lines (30 loc) · 977 Bytes
/
AppContainer.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
import { useFathom } from "@shared/generic-react-hooks";
import { Flowbite } from "@shared/ui";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { NextIntlProvider } from "next-intl";
import { AppProps } from "next/app";
import { useRouter } from "next/router";
// React Query Client:
const queryClient = new QueryClient();
export const AppContainer = (props: AppProps) => {
const { Component, pageProps } = props;
const router = useRouter();
// Fathom Analytics
useFathom(
process.env.NEXT_PUBLIC_FATHOM_SITE_ID as string,
["pooltogether.com"],
// @ts-ignore
router.events?.on,
router.events?.off
);
return (
<Flowbite theme={{ dark: true }}>
<QueryClientProvider client={queryClient}>
<NextIntlProvider messages={pageProps.messages}>
<div id="modal-root" />
<Component {...pageProps} />
</NextIntlProvider>
</QueryClientProvider>
</Flowbite>
);
};