Revert "Unify workspace dropdowns; Update layouts (#458)"
This reverts commit 4bc8448a1d.
This commit is contained in:
@@ -1,5 +1,58 @@
|
||||
import { headers } from 'next/headers';
|
||||
|
||||
import { Toaster } from '@kit/ui/sonner';
|
||||
import { cn } from '@kit/ui/utils';
|
||||
|
||||
import { RootProviders } from '~/components/root-providers';
|
||||
import { getFontsClassName } from '~/lib/fonts';
|
||||
import { createI18nServerInstance } from '~/lib/i18n/i18n.server';
|
||||
import { generateRootMetadata } from '~/lib/root-metadata';
|
||||
import { getRootTheme } from '~/lib/root-theme';
|
||||
|
||||
import '../styles/globals.css';
|
||||
|
||||
export default function RootLayout({ children }: React.PropsWithChildren) {
|
||||
return children;
|
||||
export const generateMetadata = () => {
|
||||
return generateRootMetadata();
|
||||
};
|
||||
|
||||
export default async function RootLayout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
const [theme, nonce, i18n] = await Promise.all([
|
||||
getRootTheme(),
|
||||
getCspNonce(),
|
||||
createI18nServerInstance(),
|
||||
]);
|
||||
|
||||
const className = getRootClassName(theme);
|
||||
const language = i18n.language;
|
||||
|
||||
return (
|
||||
<html lang={language} className={className}>
|
||||
<body>
|
||||
<RootProviders theme={theme} lang={language} nonce={nonce}>
|
||||
{children}
|
||||
</RootProviders>
|
||||
|
||||
<Toaster richColors={true} theme={theme} position="top-center" />
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
|
||||
function getRootClassName(theme: string) {
|
||||
const fontsClassName = getFontsClassName(theme);
|
||||
|
||||
return cn(
|
||||
'bg-background min-h-screen antialiased md:overscroll-y-none',
|
||||
fontsClassName,
|
||||
);
|
||||
}
|
||||
|
||||
async function getCspNonce() {
|
||||
const headersStore = await headers();
|
||||
|
||||
return headersStore.get('x-nonce') ?? undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user