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 (
|
return (
|
||||||
<Html lang="en">
|
<Html lang="en">
|
||||||
<Head>
|
<Head>
|
||||||
|
<meta charSet="utf-8" />
|
||||||
<link rel="preload" href="/hohoho.mp3" as="audio" type="audio/mpeg" />
|
<link rel="preload" href="/hohoho.mp3" as="audio" type="audio/mpeg" />
|
||||||
</Head>
|
</Head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -6,8 +6,9 @@ import type React from "react"
|
|||||||
import { NotificationProvider } from "@/lib/notification-context"
|
import { NotificationProvider } from "@/lib/notification-context"
|
||||||
import { Metadata, Viewport } from "next"
|
import { Metadata, Viewport } from "next"
|
||||||
import KeepOnlineWrapper from "@/components/layout/KeepOnlineWrapper"
|
import KeepOnlineWrapper from "@/components/layout/KeepOnlineWrapper"
|
||||||
import { ChristmasDecorations } from "@/components/christmas-decorations"
|
// Christmas theme disabled
|
||||||
import { isDecember } from "@/lib/utils/christmas"
|
// import { ChristmasDecorations } from "@/components/christmas-decorations"
|
||||||
|
// import { isDecember } from "@/lib/utils/christmas"
|
||||||
import { AudioPreloader } from "@/components/audio-preloader"
|
import { AudioPreloader } from "@/components/audio-preloader"
|
||||||
|
|
||||||
const inter = Inter({ subsets: ["latin"] })
|
const inter = Inter({ subsets: ["latin"] })
|
||||||
@@ -72,15 +73,15 @@ export default function RootLayout({
|
|||||||
}: {
|
}: {
|
||||||
children: React.ReactNode
|
children: React.ReactNode
|
||||||
}) {
|
}) {
|
||||||
const isDec = isDecember()
|
const isDec = false // Christmas theme disabled
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<html lang="en" suppressHydrationWarning className={isDec ? "christmas-theme" : ""}>
|
<html lang="en" suppressHydrationWarning className="dark">
|
||||||
<body className={inter.className}>
|
<body className={inter.className}>
|
||||||
<ThemeProvider attribute="class" defaultTheme="dark" enableSystem disableTransitionOnChange>
|
<ThemeProvider attribute="class" defaultTheme="dark" enableSystem disableTransitionOnChange>
|
||||||
<AudioPreloader />
|
<AudioPreloader />
|
||||||
<NotificationProvider>
|
<NotificationProvider>
|
||||||
{isDec && <ChristmasDecorations />}
|
{/* Christmas decorations disabled */}
|
||||||
<Toaster
|
<Toaster
|
||||||
theme="dark"
|
theme="dark"
|
||||||
richColors
|
richColors
|
||||||
|
|||||||
@@ -94,9 +94,9 @@ export default function RevenueChart({ timeRange, hideNumbers = false }: Revenue
|
|||||||
if (active && payload && payload.length) {
|
if (active && payload && payload.length) {
|
||||||
const data = payload[0].payload;
|
const data = payload[0].payload;
|
||||||
return (
|
return (
|
||||||
<div className="bg-white p-3 border border-gray-200 rounded-lg shadow-lg">
|
<div className="bg-background p-3 border border-border rounded-lg shadow-lg">
|
||||||
<p className="text-sm font-medium text-gray-900">{data.formattedDate}</p>
|
<p className="text-sm font-medium text-foreground">{data.formattedDate}</p>
|
||||||
<p className="text-sm text-blue-600">
|
<p className="text-sm text-blue-600 dark:text-blue-400">
|
||||||
Revenue: <span className="font-semibold">{hideNumbers ? '£***' : formatGBP(data.revenue)}</span>
|
Revenue: <span className="font-semibold">{hideNumbers ? '£***' : formatGBP(data.revenue)}</span>
|
||||||
</p>
|
</p>
|
||||||
<p className="text-sm text-green-600">
|
<p className="text-sm text-green-600">
|
||||||
|
|||||||
@@ -473,7 +473,7 @@ export default function ChatDetail({ chatId }: { chatId: string }) {
|
|||||||
content: newMessage
|
content: newMessage
|
||||||
}),
|
}),
|
||||||
headers: {
|
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), [])
|
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 (
|
return (
|
||||||
<div className={`flex h-screen ${theme === "dark" ? "dark" : ""}`}>
|
<div className="flex h-screen">
|
||||||
<Sidebar />
|
<Sidebar />
|
||||||
<div className="w-full flex flex-1 flex-col">
|
<div className="w-full flex flex-1 flex-col">
|
||||||
{!isChatDetailPage && !isAdminPage && (
|
{!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">
|
<div className="flex items-center space-x-2">
|
||||||
<UnifiedNotifications />
|
<UnifiedNotifications />
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</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}
|
{children}
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
/**
|
/**
|
||||||
* Check if the current date is in December
|
* Check if the current date is in December
|
||||||
* @returns true if current month is December (0-indexed, so 11 = December)
|
* @returns true if current month is December (0-indexed, so 11 = December)
|
||||||
|
* DISABLED: Christmas theme is currently disabled
|
||||||
*/
|
*/
|
||||||
export function isDecember(): boolean {
|
export function isDecember(): boolean {
|
||||||
const now = new Date();
|
// Christmas theme disabled
|
||||||
return now.getMonth() === 11; // December is month 11 (0-indexed)
|
return false;
|
||||||
|
// const now = new Date();
|
||||||
|
// return now.getMonth() === 11; // December is month 11 (0-indexed)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user