2024-05-17 15:02:40 +00:00
|
|
|
"use client";
|
|
|
|
|
2024-05-08 17:31:20 +00:00
|
|
|
import { ReactNode } from "react";
|
2024-05-22 07:04:57 +00:00
|
|
|
import { ThemeProvider, useTheme } from "next-themes";
|
2024-05-17 15:02:40 +00:00
|
|
|
import { SWRConfig } from "swr";
|
2024-05-22 07:04:57 +00:00
|
|
|
// ui
|
|
|
|
import { Toast } from "@plane/ui";
|
2024-05-17 15:02:40 +00:00
|
|
|
// constants
|
|
|
|
import { SWR_CONFIG } from "@/constants/swr-config";
|
2024-05-10 09:53:51 +00:00
|
|
|
// helpers
|
2024-05-22 07:04:57 +00:00
|
|
|
import { ASSET_PREFIX, resolveGeneralTheme } from "@/helpers/common.helper";
|
2024-05-14 15:24:49 +00:00
|
|
|
// lib
|
2024-05-17 15:02:40 +00:00
|
|
|
import { InstanceProvider } from "@/lib/instance-provider";
|
|
|
|
import { StoreProvider } from "@/lib/store-provider";
|
|
|
|
import { UserProvider } from "@/lib/user-provider";
|
2024-05-08 17:31:20 +00:00
|
|
|
// styles
|
|
|
|
import "./globals.css";
|
|
|
|
|
2024-05-17 15:02:40 +00:00
|
|
|
function RootLayout({ children }: { children: ReactNode }) {
|
2024-05-22 07:04:57 +00:00
|
|
|
// themes
|
|
|
|
const { resolvedTheme } = useTheme();
|
|
|
|
|
2024-05-14 15:24:49 +00:00
|
|
|
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`}>
|
2024-05-17 15:02:40 +00:00
|
|
|
<ThemeProvider themes={["light", "dark"]} defaultTheme="system" enableSystem>
|
2024-05-22 07:04:57 +00:00
|
|
|
<Toast theme={resolveGeneralTheme(resolvedTheme)} />
|
2024-05-17 15:02:40 +00:00
|
|
|
<SWRConfig value={SWR_CONFIG}>
|
|
|
|
<StoreProvider>
|
|
|
|
<InstanceProvider>
|
|
|
|
<UserProvider>{children}</UserProvider>
|
|
|
|
</InstanceProvider>
|
|
|
|
</StoreProvider>
|
|
|
|
</SWRConfig>
|
|
|
|
</ThemeProvider>
|
2024-05-14 15:24:49 +00:00
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
);
|
|
|
|
}
|
2024-05-17 15:02:40 +00:00
|
|
|
|
|
|
|
export default RootLayout;
|