Files
my-protfolio/src/app/layout.tsx
Amirhossein Khalili 7fb58ff718
Some checks failed
Test and deploy / Verify production build (push) Has been cancelled
Test and deploy / Deploy production (push) Has been cancelled
feat(loading): preload portfolio assets before reveal
2026-09-07 00:20:06 +03:30

46 lines
1.2 KiB
TypeScript

import type { Metadata } from 'next';
import { ThemeProvider } from '@/context/ThemeContext';
import '@/styles/globals.css';
export const metadata: Metadata = {
title: "Amirhossein Khalili | Dedicated Product Engineer",
description:
"Personal portfolio of Amirhossein Khalili, Product Engineer & Software Developer based in Iran.",
keywords: [
'Amirhossein Khalili',
'Product Engineer',
'Software Engineer',
'Full Stack Developer',
'Portfolio',
],
};
const themeScript = `
document.documentElement.dataset.siteLoading = 'true';
try {
const savedTheme = localStorage.getItem('portfolio-theme');
const systemTheme = matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
document.documentElement.dataset.theme = savedTheme || systemTheme;
} catch {}
`;
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en" suppressHydrationWarning>
<head>
<script dangerouslySetInnerHTML={{ __html: themeScript }} />
</head>
<body>
<ThemeProvider>{children}</ThemeProvider>
<noscript>
<style>{`#site-loader { display: none !important; }`}</style>
</noscript>
</body>
</html>
);
}