UWU
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
import { useState, useEffect } from "react"
|
||||
import { useTheme } from "next-themes"
|
||||
import { usePathname } from "next/navigation"
|
||||
import Sidebar from "./sidebar"
|
||||
import UnifiedNotifications from "@/components/notifications/UnifiedNotifications"
|
||||
import type React from "react"
|
||||
@@ -13,6 +14,10 @@ interface LayoutProps {
|
||||
export default function Layout({ children }: LayoutProps) {
|
||||
const { theme } = useTheme()
|
||||
const [mounted, setMounted] = useState(false)
|
||||
const pathname = usePathname()
|
||||
|
||||
// Check if we're in a chat detail page
|
||||
const isChatDetailPage = pathname?.includes('/dashboard/chats/') && !pathname?.endsWith('/chats') && !pathname?.endsWith('/new')
|
||||
|
||||
useEffect(() => setMounted(true), [])
|
||||
|
||||
@@ -27,7 +32,9 @@ export default function Layout({ children }: LayoutProps) {
|
||||
<UnifiedNotifications />
|
||||
</div>
|
||||
</header>
|
||||
<main className="flex-1 overflow-auto p-6 dark:bg-[#0F0F12]">{children}</main>
|
||||
<main className={`flex-1 overflow-auto ${isChatDetailPage ? 'p-0' : 'p-6'} dark:bg-[#0F0F12]`}>
|
||||
{children}
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user