forked from github/plane
6595a387d0
* fix: event tracker changes * fix: App provider implementation using wrappers * fix: updating packages * fix: handling warning * fix: wrapper fixes and minor optimization changes * fix: chore app-provider clearnup * fix: cleanup * fix: removing jitsu tracking * fix: minor updates * fix: adding event to posthog event tracker (#2802) * dev: posthog event tracker update intitiate * fix: adding events for posthog integration * fix: event payload --------- Co-authored-by: Ramesh Kumar Chandra <31303617+rameshkumarchandra@users.noreply.github.com>
48 lines
1.4 KiB
TypeScript
48 lines
1.4 KiB
TypeScript
import { ReactElement } from "react";
|
|
import Head from "next/head";
|
|
import { AppProps } from "next/app";
|
|
import { ThemeProvider } from "next-themes";
|
|
// styles
|
|
import "styles/globals.css";
|
|
import "styles/editor.css";
|
|
import "styles/table.css";
|
|
import "styles/command-pallette.css";
|
|
import "styles/nprogress.css";
|
|
import "styles/react-datepicker.css";
|
|
// contexts
|
|
import { ToastContextProvider } from "contexts/toast.context";
|
|
// constants
|
|
import { THEMES } from "constants/themes";
|
|
import { SITE_TITLE } from "constants/seo-variables";
|
|
// mobx store provider
|
|
import { MobxStoreProvider } from "lib/mobx/store-provider";
|
|
import { AppProvider } from "lib/app-provider";
|
|
// types
|
|
import { NextPageWithLayout } from "types/app";
|
|
|
|
type AppPropsWithLayout = AppProps & {
|
|
Component: NextPageWithLayout;
|
|
};
|
|
|
|
function MyApp({ Component, pageProps }: AppPropsWithLayout) {
|
|
// Use the layout defined at the page level, if available
|
|
const getLayout = Component.getLayout ?? ((page: ReactElement) => page);
|
|
|
|
return (
|
|
<>
|
|
<Head>
|
|
<title>{SITE_TITLE}</title>
|
|
</Head>
|
|
<MobxStoreProvider {...pageProps}>
|
|
<ThemeProvider themes={THEMES} defaultTheme="system">
|
|
<ToastContextProvider>
|
|
<AppProvider>{getLayout(<Component {...pageProps} />)}</AppProvider>
|
|
</ToastContextProvider>
|
|
</ThemeProvider>
|
|
</MobxStoreProvider>
|
|
</>
|
|
);
|
|
}
|
|
|
|
export default MyApp;
|