From a95becc13b1a679926a6502f3713ea8b1fd18174 Mon Sep 17 00:00:00 2001 From: siri1410 <7946331+siri1410@users.noreply.github.com> Date: Fri, 28 Mar 2025 14:21:51 -0400 Subject: [PATCH] Fixed Deployment Issues --- .env | 4 +++- app/layout.tsx | 32 +++++++++++++++++++++++++++++--- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/.env b/.env index 1724187..23570db 100644 --- a/.env +++ b/.env @@ -1,2 +1,4 @@ - NEXT_PUBLIC_CLERK_ENABLE_KEYLESS=true +NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_c2hhcnAtZmlsbHktNTAuY2xlcmsuYWNjb3VudHMuZGV2JA +CLERK_SECRET_KEY=sk_test_AzxBdooH2w7KLq0GyMPHMANAeK3WtWBqMR9ggFtByK +ANTHROPIC_API_KEY=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 diff --git a/app/layout.tsx b/app/layout.tsx index 5c091f2..61161e2 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -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 ( + + +
+ {/* Placeholder for auth buttons when Clerk is disabled */} +
+ + +
+
+ {children} + + + ); + } + + // Render with Clerk if it's enabled return (