mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
44 lines
1.2 KiB
TypeScript
44 lines
1.2 KiB
TypeScript
import { ReactElement } from "react";
|
|
import { AppProps } from "next/app";
|
|
import Head from "next/head";
|
|
import { ThemeProvider } from "next-themes";
|
|
// styles
|
|
import "@/styles/globals.css";
|
|
import "@/styles/command-pallette.css";
|
|
import "@/styles/nprogress.css";
|
|
import "@/styles/emoji.css";
|
|
import "@/styles/react-day-picker.css";
|
|
// constants
|
|
import { SITE_TITLE } from "@/constants/seo-variables";
|
|
import { THEMES } from "@/constants/themes";
|
|
// mobx store provider
|
|
import { StoreProvider } from "@/contexts/store-context";
|
|
|
|
import { AppProvider } from "@/lib/app-provider";
|
|
// types
|
|
import { NextPageWithLayout } from "@/lib/types";
|
|
|
|
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>
|
|
<StoreProvider {...pageProps}>
|
|
<ThemeProvider themes={THEMES} defaultTheme="system">
|
|
<AppProvider>{getLayout(<Component {...pageProps} />)}</AppProvider>
|
|
</ThemeProvider>
|
|
</StoreProvider>
|
|
</>
|
|
);
|
|
}
|
|
|
|
export default MyApp;
|