mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
14ac885e55
* migrated table to new project structure * fixed range errors while deleting table nodes with no nodes below and removed console logs * fixed css for rendering table menu * removed old table menu * added support for read only editors as well * text-black removed * added design colors --------- Co-authored-by: sriram veeraghanta <veeraghanta.sriram@gmail.com>
61 lines
1.8 KiB
TypeScript
61 lines
1.8 KiB
TypeScript
import { ReactElement } from "react";
|
|
import Head from "next/head";
|
|
import dynamic from "next/dynamic";
|
|
import Router from "next/router";
|
|
import { AppProps } from "next/app";
|
|
import { ThemeProvider } from "next-themes";
|
|
import NProgress from "nprogress";
|
|
// 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 MobxStoreInit from "lib/mobx/store-init";
|
|
// types
|
|
import { NextPageWithLayout } from "types/app";
|
|
|
|
const CrispWithNoSSR = dynamic(() => import("constants/crisp"), { ssr: false });
|
|
|
|
// nprogress
|
|
NProgress.configure({ showSpinner: false });
|
|
Router.events.on("routeChangeStart", NProgress.start);
|
|
Router.events.on("routeChangeError", NProgress.done);
|
|
Router.events.on("routeChangeComplete", NProgress.done);
|
|
|
|
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>
|
|
<CrispWithNoSSR />
|
|
<MobxStoreInit />
|
|
{getLayout(<Component {...pageProps} />)}
|
|
</ToastContextProvider>
|
|
</ThemeProvider>
|
|
</MobxStoreProvider>
|
|
</>
|
|
);
|
|
}
|
|
|
|
export default MyApp;
|