Fixed Deployment Issues

This commit is contained in:
siri1410 2025-03-28 14:21:51 -04:00
parent d49f09e622
commit a95becc13b
2 changed files with 32 additions and 4 deletions

View file

@ -1,12 +1,12 @@
import type { Metadata } from "next";
import {
ClerkProvider,
SignInButton,
SignUpButton,
SignedIn,
SignedOut,
SignInButton,
SignUpButton,
UserButton,
} from "@clerk/nextjs";
import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import "../styles/tailwind.css";
@ -25,11 +25,37 @@ export const metadata: Metadata = {
description: "Generated by create next app",
};
// Check if Clerk is enabled
const isClerkEnabled =
process.env.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY &&
process.env.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY !== 'pk_test_YOUR_PUBLISHABLE_KEY';
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
// Render the layout without Clerk if it's not enabled
if (!isClerkEnabled) {
return (
<html lang="en">
<body
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
>
<header className="flex justify-end items-center p-4 gap-4 h-16">
{/* Placeholder for auth buttons when Clerk is disabled */}
<div className="flex gap-4">
<button className="text-sm font-medium">Sign In</button>
<button className="text-sm font-medium">Sign Up</button>
</div>
</header>
{children}
</body>
</html>
);
}
// Render with Clerk if it's enabled
return (
<ClerkProvider>
<html lang="en">