mirror of
https://github.com/makeplane/plane
synced 2025-08-07 19:59:33 +00:00
* [WEB-3985] feat: common postcss config and local fonts across all plane applications * improvement: split fonts into a separate exports
48 lines
1.8 KiB
TypeScript
48 lines
1.8 KiB
TypeScript
"use client";
|
|
|
|
import { ReactNode } from "react";
|
|
import { ThemeProvider, useTheme } from "next-themes";
|
|
import { SWRConfig } from "swr";
|
|
// plane imports
|
|
import { ADMIN_BASE_PATH, DEFAULT_SWR_CONFIG } from "@plane/constants";
|
|
import { Toast } from "@plane/ui";
|
|
import { resolveGeneralTheme } from "@plane/utils";
|
|
// lib
|
|
import { InstanceProvider } from "@/lib/instance-provider";
|
|
import { StoreProvider } from "@/lib/store-provider";
|
|
import { UserProvider } from "@/lib/user-provider";
|
|
// styles
|
|
import "@/styles/globals.css";
|
|
|
|
const ToastWithTheme = () => {
|
|
const { resolvedTheme } = useTheme();
|
|
return <Toast theme={resolveGeneralTheme(resolvedTheme)} />;
|
|
};
|
|
|
|
export default function RootLayout({ children }: { children: ReactNode }) {
|
|
const ASSET_PREFIX = ADMIN_BASE_PATH;
|
|
return (
|
|
<html lang="en">
|
|
<head>
|
|
<link rel="apple-touch-icon" sizes="180x180" href={`${ASSET_PREFIX}/favicon/apple-touch-icon.png`} />
|
|
<link rel="icon" type="image/png" sizes="32x32" href={`${ASSET_PREFIX}/favicon/favicon-32x32.png`} />
|
|
<link rel="icon" type="image/png" sizes="16x16" href={`${ASSET_PREFIX}/favicon/favicon-16x16.png`} />
|
|
<link rel="manifest" href={`${ASSET_PREFIX}/site.webmanifest.json`} />
|
|
<link rel="shortcut icon" href={`${ASSET_PREFIX}/favicon/favicon.ico`} />
|
|
</head>
|
|
<body className={`antialiased`}>
|
|
<ThemeProvider themes={["light", "dark"]} defaultTheme="system" enableSystem>
|
|
<ToastWithTheme />
|
|
<SWRConfig value={DEFAULT_SWR_CONFIG}>
|
|
<StoreProvider>
|
|
<InstanceProvider>
|
|
<UserProvider>{children}</UserProvider>
|
|
</InstanceProvider>
|
|
</StoreProvider>
|
|
</SWRConfig>
|
|
</ThemeProvider>
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|