chore: bump version to 2.20.1 in package.json and refactor layout and… (#404)

* chore: bump version to 2.20.1 in package.json and refactor layout and form components

- Incremented application version from 2.20.0 to 2.20.1 in package.json.
- Refactored RootLayout to optimize asynchronous calls and introduced getRootClassName function for better class management.
- Updated font handling in getFontsClassName function to streamline class generation.
- Enhanced various authentication form components by replacing Input with EmailInput and PasswordInput for improved consistency and usability.
- Adjusted layout styles in AuthLayoutShell and other components for better responsiveness.

* fix: improve content rendering fallback logic in ContentRenderer component

- Enhanced the ContentRenderer function to explicitly check for the presence of a renderer before returning content.
- Added a fallback mechanism to return raw content as React nodes when no renderer is found, improving robustness and user experience.
This commit is contained in:
Giancarlo Buomprisco
2025-11-02 16:14:21 +07:00
committed by GitHub
parent 116d41a284
commit ac12c9355c
14 changed files with 248 additions and 226 deletions

View File

@@ -1,6 +1,7 @@
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';
@@ -19,13 +20,17 @@ export default async function RootLayout({
}: {
children: React.ReactNode;
}) {
const { language } = await createI18nServerInstance();
const theme = await getRootTheme();
const className = getFontsClassName(theme);
const nonce = await getCspNonce();
const [theme, nonce, i18n] = await Promise.all([
getRootTheme(),
getCspNonce(),
createI18nServerInstance(),
]);
const className = getRootClassName(theme);
const language = i18n.language;
return (
<html lang={language} className={`${className} overscroll-y-none`}>
<html lang={language} className={className}>
<body>
<RootProviders theme={theme} lang={language} nonce={nonce}>
{children}
@@ -37,6 +42,15 @@ export default async function RootLayout({
);
}
function getRootClassName(theme: string) {
const fontsClassName = getFontsClassName(theme);
return cn(
'bg-background min-h-screen overscroll-y-none antialiased',
fontsClassName,
);
}
async function getCspNonce() {
const headersStore = await headers();