2023-11-02 18:27:44 +00:00
|
|
|
import { ReactElement } from "react";
|
2023-06-05 12:18:29 +00:00
|
|
|
import Head from "next/head";
|
2023-11-02 18:27:44 +00:00
|
|
|
import { AppProps } from "next/app";
|
2023-01-26 18:12:20 +00:00
|
|
|
// styles
|
|
|
|
import "styles/globals.css";
|
2022-11-19 14:21:26 +00:00
|
|
|
import "styles/editor.css";
|
2023-11-05 13:24:00 +00:00
|
|
|
import "styles/table.css";
|
2023-03-28 09:19:27 +00:00
|
|
|
import "styles/command-pallette.css";
|
2023-03-22 13:35:36 +00:00
|
|
|
import "styles/nprogress.css";
|
2023-05-05 10:15:53 +00:00
|
|
|
import "styles/react-datepicker.css";
|
2023-04-20 08:11:24 +00:00
|
|
|
// constants
|
2023-09-14 11:08:41 +00:00
|
|
|
import { SITE_TITLE } from "constants/seo-variables";
|
2023-08-08 07:20:27 +00:00
|
|
|
// mobx store provider
|
|
|
|
import { MobxStoreProvider } from "lib/mobx/store-provider";
|
2023-11-20 07:59:54 +00:00
|
|
|
import { AppProvider } from "lib/app-provider";
|
2023-11-02 18:27:44 +00:00
|
|
|
// types
|
|
|
|
import { NextPageWithLayout } from "types/app";
|
2022-11-19 14:21:26 +00:00
|
|
|
|
2023-11-02 18:27:44 +00:00
|
|
|
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);
|
|
|
|
|
2022-11-19 14:21:26 +00:00
|
|
|
return (
|
2023-09-14 11:08:41 +00:00
|
|
|
<>
|
|
|
|
<Head>
|
|
|
|
<title>{SITE_TITLE}</title>
|
|
|
|
</Head>
|
|
|
|
<MobxStoreProvider {...pageProps}>
|
2023-11-29 15:03:08 +00:00
|
|
|
<AppProvider>{getLayout(<Component {...pageProps} />)}</AppProvider>
|
2023-09-14 11:08:41 +00:00
|
|
|
</MobxStoreProvider>
|
|
|
|
</>
|
2022-11-19 14:21:26 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default MyApp;
|