Disable Christmas theme and improve layout skeleton
Christmas decorations and theme logic have been disabled throughout the app, including the isDecember utility, layout, and related imports. Layout now shows a skeleton UI while mounting to prevent layout shift. Minor improvements to RevenueChart tooltip colors and ChatDetail request headers for better consistency.
This commit is contained in:
@@ -4,6 +4,7 @@ export default function Document() {
|
||||
return (
|
||||
<Html lang="en">
|
||||
<Head>
|
||||
<meta charSet="utf-8" />
|
||||
<link rel="preload" href="/hohoho.mp3" as="audio" type="audio/mpeg" />
|
||||
</Head>
|
||||
<body>
|
||||
|
||||
@@ -6,8 +6,9 @@ import type React from "react"
|
||||
import { NotificationProvider } from "@/lib/notification-context"
|
||||
import { Metadata, Viewport } from "next"
|
||||
import KeepOnlineWrapper from "@/components/layout/KeepOnlineWrapper"
|
||||
import { ChristmasDecorations } from "@/components/christmas-decorations"
|
||||
import { isDecember } from "@/lib/utils/christmas"
|
||||
// Christmas theme disabled
|
||||
// import { ChristmasDecorations } from "@/components/christmas-decorations"
|
||||
// import { isDecember } from "@/lib/utils/christmas"
|
||||
import { AudioPreloader } from "@/components/audio-preloader"
|
||||
|
||||
const inter = Inter({ subsets: ["latin"] })
|
||||
@@ -72,15 +73,15 @@ export default function RootLayout({
|
||||
}: {
|
||||
children: React.ReactNode
|
||||
}) {
|
||||
const isDec = isDecember()
|
||||
const isDec = false // Christmas theme disabled
|
||||
|
||||
return (
|
||||
<html lang="en" suppressHydrationWarning className={isDec ? "christmas-theme" : ""}>
|
||||
<html lang="en" suppressHydrationWarning className="dark">
|
||||
<body className={inter.className}>
|
||||
<ThemeProvider attribute="class" defaultTheme="dark" enableSystem disableTransitionOnChange>
|
||||
<AudioPreloader />
|
||||
<NotificationProvider>
|
||||
{isDec && <ChristmasDecorations />}
|
||||
{/* Christmas decorations disabled */}
|
||||
<Toaster
|
||||
theme="dark"
|
||||
richColors
|
||||
|
||||
@@ -94,9 +94,9 @@ export default function RevenueChart({ timeRange, hideNumbers = false }: Revenue
|
||||
if (active && payload && payload.length) {
|
||||
const data = payload[0].payload;
|
||||
return (
|
||||
<div className="bg-white p-3 border border-gray-200 rounded-lg shadow-lg">
|
||||
<p className="text-sm font-medium text-gray-900">{data.formattedDate}</p>
|
||||
<p className="text-sm text-blue-600">
|
||||
<div className="bg-background p-3 border border-border rounded-lg shadow-lg">
|
||||
<p className="text-sm font-medium text-foreground">{data.formattedDate}</p>
|
||||
<p className="text-sm text-blue-600 dark:text-blue-400">
|
||||
Revenue: <span className="font-semibold">{hideNumbers ? '£***' : formatGBP(data.revenue)}</span>
|
||||
</p>
|
||||
<p className="text-sm text-green-600">
|
||||
|
||||
@@ -473,7 +473,7 @@ export default function ChatDetail({ chatId }: { chatId: string }) {
|
||||
content: newMessage
|
||||
}),
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
'Content-Type': 'application/json; charset=utf-8'
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -23,20 +23,39 @@ export default function Layout({ children }: LayoutProps) {
|
||||
|
||||
useEffect(() => setMounted(true), [])
|
||||
|
||||
if (!mounted) return null
|
||||
// Show skeleton while mounting to prevent layout shift
|
||||
if (!mounted) {
|
||||
return (
|
||||
<div className="flex h-screen">
|
||||
<Sidebar />
|
||||
<div className="w-full flex flex-1 flex-col">
|
||||
{!isChatDetailPage && !isAdminPage && (
|
||||
<header className="h-16 border-b border-border flex items-center justify-end px-6 bg-background">
|
||||
<div className="flex items-center space-x-2">
|
||||
<div className="h-10 w-10 bg-muted animate-pulse rounded" />
|
||||
</div>
|
||||
</header>
|
||||
)}
|
||||
<main className={`flex-1 ${isChatDetailPage ? 'p-0 overflow-hidden' : 'p-6 overflow-auto'} bg-background relative`}>
|
||||
{children}
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={`flex h-screen ${theme === "dark" ? "dark" : ""}`}>
|
||||
<div className="flex h-screen">
|
||||
<Sidebar />
|
||||
<div className="w-full flex flex-1 flex-col">
|
||||
{!isChatDetailPage && !isAdminPage && (
|
||||
<header className="h-16 border-b border-border flex items-center justify-end px-6">
|
||||
<header className="h-16 border-b border-border flex items-center justify-end px-6 bg-background">
|
||||
<div className="flex items-center space-x-2">
|
||||
<UnifiedNotifications />
|
||||
</div>
|
||||
</header>
|
||||
)}
|
||||
<main className={`flex-1 ${isChatDetailPage ? 'p-0 overflow-hidden' : 'p-6 overflow-auto'} dark:bg-[#0F0F12] relative`}>
|
||||
<main className={`flex-1 ${isChatDetailPage ? 'p-0 overflow-hidden' : 'p-6 overflow-auto'} bg-background relative`}>
|
||||
{children}
|
||||
</main>
|
||||
</div>
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
/**
|
||||
* Check if the current date is in December
|
||||
* @returns true if current month is December (0-indexed, so 11 = December)
|
||||
* DISABLED: Christmas theme is currently disabled
|
||||
*/
|
||||
export function isDecember(): boolean {
|
||||
const now = new Date();
|
||||
return now.getMonth() === 11; // December is month 11 (0-indexed)
|
||||
// Christmas theme disabled
|
||||
return false;
|
||||
// const now = new Date();
|
||||
// return now.getMonth() === 11; // December is month 11 (0-indexed)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user