mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
804dd8300d
* fix: add multiple module in an issue * feat: implemented multiple modules select in the issue detail and issue peekoverview and resolved build errors. * feat: handled module parameters type error in the issue create and draft modal * feat: handled UI for modules select dropdown * fix: delete module activity updated * ui: module issue activity * fix: module search endpoint and issue fetch in the modules * fix: module ids optimized * fix: replaced module_id from boolean to array of module Id's in module search modal params --------- Co-authored-by: NarayanBavisetti <narayan3119@gmail.com>
67 lines
2.2 KiB
TypeScript
67 lines
2.2 KiB
TypeScript
import { FC, ReactNode } from "react";
|
|
import dynamic from "next/dynamic";
|
|
import Router from "next/router";
|
|
import NProgress from "nprogress";
|
|
import { observer } from "mobx-react-lite";
|
|
import { ThemeProvider } from "next-themes";
|
|
// hooks
|
|
import { useApplication, useUser } from "hooks/store";
|
|
// constants
|
|
import { THEMES } from "constants/themes";
|
|
// layouts
|
|
import InstanceLayout from "layouts/instance-layout";
|
|
// contexts
|
|
import { ToastContextProvider } from "contexts/toast.context";
|
|
import { SWRConfig } from "swr";
|
|
// constants
|
|
import { SWR_CONFIG } from "constants/swr-config";
|
|
// dynamic imports
|
|
const StoreWrapper = dynamic(() => import("lib/wrappers/store-wrapper"), { ssr: false });
|
|
const PosthogWrapper = dynamic(() => import("lib/wrappers/posthog-wrapper"), { ssr: false });
|
|
const CrispWrapper = dynamic(() => import("lib/wrappers/crisp-wrapper"), { 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);
|
|
|
|
export interface IAppProvider {
|
|
children: ReactNode;
|
|
}
|
|
|
|
export const AppProvider: FC<IAppProvider> = observer((props) => {
|
|
const { children } = props;
|
|
// store hooks
|
|
const {
|
|
currentUser,
|
|
membership: { currentProjectRole, currentWorkspaceRole },
|
|
} = useUser();
|
|
const {
|
|
config: { envConfig },
|
|
} = useApplication();
|
|
|
|
return (
|
|
<ThemeProvider themes={THEMES} defaultTheme="system">
|
|
<ToastContextProvider>
|
|
<InstanceLayout>
|
|
<StoreWrapper>
|
|
<CrispWrapper user={currentUser}>
|
|
{/* <PosthogWrapper
|
|
user={currentUser}
|
|
workspaceRole={currentWorkspaceRole}
|
|
projectRole={currentProjectRole}
|
|
posthogAPIKey={envConfig?.posthog_api_key || null}
|
|
posthogHost={envConfig?.posthog_host || null}
|
|
>
|
|
<SWRConfig value={SWR_CONFIG}>{children}</SWRConfig>
|
|
</PosthogWrapper> */}
|
|
<SWRConfig value={SWR_CONFIG}>{children}</SWRConfig>
|
|
</CrispWrapper>
|
|
</StoreWrapper>
|
|
</InstanceLayout>
|
|
</ToastContextProvider>
|
|
</ThemeProvider>
|
|
);
|
|
});
|