35 lines
1.0 KiB
TypeScript
35 lines
1.0 KiB
TypeScript
// First: fills the server module graph before anything renders.
|
|
import '../bootstrap/bootstrap.server';
|
|
import '../styles/app.css';
|
|
|
|
import { CRITICAL_FONT_URL } from '@lumina/island/constants';
|
|
import { Element } from '@lumina/island/primitives/element';
|
|
import type { Metadata } from 'next';
|
|
import type { ReactNode } from 'react';
|
|
import { preload } from 'react-dom';
|
|
|
|
import { rootMetadata } from '../configs';
|
|
import { i18n } from '../i18n';
|
|
import { AppProviders } from './organisms/app-providers';
|
|
|
|
export function generateMetadata(): Metadata {
|
|
return rootMetadata();
|
|
}
|
|
|
|
export default function RootLayout({ children }: { children: ReactNode }) {
|
|
// Only the face every page renders first; the Latin face loads where شبا is shown.
|
|
preload(CRITICAL_FONT_URL, {
|
|
as: 'font',
|
|
type: 'font/woff2',
|
|
crossOrigin: 'anonymous',
|
|
});
|
|
|
|
return (
|
|
<Element tag="html" lang={i18n.language} dir={i18n.dir()}>
|
|
<Element tag="body">
|
|
<AppProviders>{children}</AppProviders>
|
|
</Element>
|
|
</Element>
|
|
);
|
|
}
|