Switch to version 2: modified src/app/layout.tsx

This commit is contained in:
2026-03-10 10:06:39 +00:00
parent 4876ede67d
commit f9920cfb76

View File

@@ -1,14 +1,14 @@
import type { Metadata } from "next";
import { DM_Sans } from "next/font/google";
import { Inter } from "next/font/google";
import "./styles/variables.css";
import "./styles/base.css";
const dmSans = DM_Sans({
variable: "--font-dm-sans", subsets: ["latin"],
const inter = Inter({
variable: "--font-inter", subsets: ["latin"],
});
export const metadata: Metadata = {
title: "Earl Boys Services", description: "Professional home services in Richmond, VA"};
title: "Earl Boys Services - Professional Home Services in Richmond VA", description: "Earl Boys Services offers professional home services including plumbing, electrical, painting, and general maintenance in Richmond, VA and surrounding areas."};
export default function RootLayout({
children,
@@ -17,20 +17,19 @@ export default function RootLayout({
}) {
return (
<html lang="en" suppressHydrationWarning>
<body className={`${dmSans.variable}`}>
<ServiceWrapper>
<Tag />
{children}
</ServiceWrapper>
<body className={`${inter.variable}`}>
{children}
<script
dangerouslySetInnerHTML={{
__html: `
(function() {
try {
const theme = localStorage.getItem('theme') || 'light';
document.documentElement.setAttribute('data-theme', theme);
} catch (e) {}
})()
let scrollTimeout;
window.addEventListener('scroll', () => {
clearTimeout(scrollTimeout);
document.documentElement.style.scrollBehavior = 'auto';
scrollTimeout = setTimeout(() => {
document.documentElement.style.scrollBehavior = 'smooth';
}, 150);
}, { passive: true });
`,
}}
/>
@@ -1405,11 +1404,3 @@ export default function RootLayout({
</html>
);
}
function ServiceWrapper({ children }: { children: React.ReactNode }) {
return <>{children}</>;
}
function Tag() {
return null;
}