Switch to version 2: modified src/app/layout.tsx
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user