Update app/layout.tsx
This commit is contained in:
parent
496d003068
commit
d61ee97439
|
|
@ -0,0 +1,151 @@
|
|||
import type { Metadata } from "next";
|
||||
import "./globals.css";
|
||||
import { GeistSans } from "geist/font/sans";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { ThemeProvider } from "@/context/theme-provider";
|
||||
import { NavBar } from "@/components/navbar";
|
||||
import { KleapScripts } from "@/components/kleap-scripts";
|
||||
import { DevToolsGuard } from "./devtools-guard";
|
||||
import { TailwindCDNClient } from "@/components/tailwind-cdn-client";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: {
|
||||
default: "InvoiceGen - Professional Invoice Generator for Freelancers - AI-Powered Solution",
|
||||
template: "%s | InvoiceGen - Professional Invoice Generator for Freelancers",
|
||||
},
|
||||
description:
|
||||
"Built with Kleap - AI-powered platform to create stunning websites and apps. Turn your ideas into reality in minutes.",
|
||||
keywords: ["SaaS", "AI", "Template", "Next.js", "React", "TypeScript"],
|
||||
authors: [{ name: "InvoiceGen Team" }],
|
||||
creator: "InvoiceGen Inc.",
|
||||
publisher: "InvoiceGen Inc.",
|
||||
icons: {
|
||||
icon: "/favicon.ico",
|
||||
shortcut: "/favicon.ico",
|
||||
apple: "/favicon.ico",
|
||||
},
|
||||
robots: {
|
||||
index: true,
|
||||
follow: true,
|
||||
googleBot: {
|
||||
index: true,
|
||||
follow: true,
|
||||
"max-video-preview": -1,
|
||||
"max-image-preview": "large",
|
||||
"max-snippet": -1,
|
||||
},
|
||||
},
|
||||
openGraph: {
|
||||
type: "website",
|
||||
locale: "en_US",
|
||||
url: process.env.NEXT_PUBLIC_URL || "https://kleap.co",
|
||||
siteName: "InvoiceGen - Professional Invoice Generator for Freelancers",
|
||||
title: "InvoiceGen - Professional Invoice Generator for Freelancers - AI-Powered Solution",
|
||||
description:
|
||||
"Built with Kleap - AI-powered platform to create stunning websites and apps. Turn your ideas into reality in minutes.",
|
||||
images: [
|
||||
{
|
||||
url: "/og-image.png",
|
||||
width: 1200,
|
||||
height: 630,
|
||||
alt: "InvoiceGen - Professional Invoice Generator for Freelancers",
|
||||
},
|
||||
],
|
||||
},
|
||||
twitter: {
|
||||
card: "summary_large_image",
|
||||
title: "InvoiceGen - Professional Invoice Generator for Freelancers - AI-Powered Solution",
|
||||
description:
|
||||
"Built with Kleap - AI-powered platform to create stunning websites and apps. Turn your ideas into reality in minutes.",
|
||||
images: ["/og-image.png"],
|
||||
creator: "@invoicegen",
|
||||
},
|
||||
metadataBase: new URL(process.env.NEXT_PUBLIC_URL || "https://kleap.co"),
|
||||
alternates: {
|
||||
canonical: "/",
|
||||
},
|
||||
};
|
||||
|
||||
export default function RootLayout({
|
||||
children,
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
return (
|
||||
<html lang="en" suppressHydrationWarning>
|
||||
<head suppressHydrationWarning>
|
||||
{/*
|
||||
CRITICAL: Base styles to prevent FOUC and hydration errors
|
||||
⚠️ DO NOT REMOVE OR MODIFY WITHOUT CAREFUL TESTING ⚠️
|
||||
React 19 requires href and precedence attributes on style tags
|
||||
*/}
|
||||
<style href="kleap-base-styles" precedence="high">{`
|
||||
/* Base styles to prevent FOUC - always rendered server+client */
|
||||
.bg-white { background-color: white; }
|
||||
.bg-black { background-color: black; }
|
||||
.text-white { color: white; }
|
||||
.text-black { color: black !important; }
|
||||
.text-neutral-700 { color: rgb(64 64 64) !important; }
|
||||
.text-neutral-600 { color: rgb(82 82 82) !important; }
|
||||
.text-neutral-500 { color: rgb(115 115 115) !important; }
|
||||
.text-muted { color: rgb(82 82 82) !important; }
|
||||
.antialiased { -webkit-font-smoothing: antialiased; }
|
||||
.h-full { height: 100%; }
|
||||
.w-full { width: 100%; }
|
||||
|
||||
/*
|
||||
IMPORTANT: Button and shadcn/ui color styles
|
||||
These classes are NOT generated by Tailwind v4 CDN and MUST be defined manually
|
||||
Without these, buttons and shadcn components will appear unstyled
|
||||
DO NOT REMOVE - Required for all shadcn/ui components to work properly
|
||||
*/
|
||||
.bg-primary { background-color: #020022; }
|
||||
.text-primary-foreground { color: hsl(0 0% 98%); }
|
||||
.hover\\:bg-primary\\/90:hover { background-color: rgba(2, 0, 34, 0.9); }
|
||||
.bg-secondary { background-color: hsl(240 4.8% 95.9%); }
|
||||
.text-secondary-foreground { color: hsl(240 5.9% 10%); }
|
||||
.hover\\:bg-secondary\\/80:hover { background-color: hsla(240, 4.8%, 95.9%, 0.8); }
|
||||
.bg-destructive { background-color: hsl(0 84.2% 60.2%); }
|
||||
.text-destructive-foreground { color: hsl(0 0% 98%); }
|
||||
.hover\\:bg-destructive\\/90:hover { background-color: hsla(0, 84.2%, 60.2%, 0.9); }
|
||||
.border-input { border-color: hsl(240 5.9% 90%); }
|
||||
.bg-background { background-color: hsl(0 0% 100%); }
|
||||
.bg-accent { background-color: hsl(240 4.8% 95.9%); }
|
||||
.text-accent-foreground { color: hsl(240 5.9% 10%); }
|
||||
.hover\\:bg-accent:hover { background-color: hsl(240 4.8% 95.9%); }
|
||||
.hover\\:text-accent-foreground:hover { color: hsl(240 5.9% 10%); }
|
||||
.ring-offset-background { --tw-ring-offset-color: hsl(0 0% 100%); }
|
||||
.focus-visible\\:ring-2:focus-visible { --tw-ring-width: 2px; }
|
||||
.focus-visible\\:ring-ring:focus-visible { --tw-ring-color: hsl(240 5.9% 10%); }
|
||||
.focus-visible\\:ring-offset-2:focus-visible { --tw-ring-offset-width: 2px; }
|
||||
|
||||
/* FOUC prevention - hide body until CSS is loaded */
|
||||
body { opacity: 1; }
|
||||
body:not(.css-loaded) { opacity: 0; }
|
||||
`}</style>
|
||||
</head>
|
||||
<body
|
||||
className={cn(
|
||||
GeistSans.className,
|
||||
"bg-white antialiased h-full w-full",
|
||||
)}
|
||||
suppressHydrationWarning // Prevents browser extension conflicts
|
||||
>
|
||||
<TailwindCDNClient />
|
||||
<DevToolsGuard />
|
||||
<ThemeProvider
|
||||
attribute="class"
|
||||
enableSystem={false}
|
||||
disableTransitionOnChange
|
||||
defaultTheme="light"
|
||||
>
|
||||
<KleapScripts />
|
||||
<main>
|
||||
<NavBar />
|
||||
{children}
|
||||
</main>
|
||||
</ThemeProvider>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
Loading…
Reference in New Issue