ultisuite-client/components/agenda/agenda-app-shell.tsx
R3D347HR4Y ad1370ea7e
Some checks are pending
E2E / Playwright e2e (push) Waiting to run
feat: enhance configuration and add new demo layouts
- Introduced turbopack alias for canvas in next.config.mjs.
- Updated package.json scripts for development and branding tasks.
- Added new dependencies for Tiptap extensions.
- Implemented new demo layouts for agenda, contacts, drive, and mail applications.
- Enhanced globals.css for improved theming and splash screen animations.
- Added OAuth callback handling for drive mounts.
- Updated layout components to integrate new demo shells and improve structure.
2026-06-12 19:10:24 +02:00

60 lines
1.9 KiB
TypeScript

"use client"
import { useEffect, useLayoutEffect, type ReactNode } from "react"
import { AiChatPanel } from "@/components/ai/ai-chat-panel"
import { AgendaOrgPolicySync } from "@/components/agenda/agenda-org-policy-sync"
import { AgendaQuickSettingsRoot } from "@/components/agenda/agenda-quick-settings-panel"
import { ComposeIdentitiesSync } from "@/components/gmail/compose-identities-sync"
import { AgendaRouteRootProvider } from "@/lib/agenda/agenda-route-context"
import { SuiteThemeShell } from "@/components/suite/suite-theme-shell"
import { TooltipProvider } from "@/components/ui/tooltip"
import { useIsMobile } from "@/hooks/use-mobile"
import { useAgendaUIStore } from "@/lib/agenda/agenda-store"
export function AgendaAppShell({
children,
routeRoot,
}: {
children: ReactNode
routeRoot?: string
}) {
const isMobile = useIsMobile()
const sidebarCollapsed = useAgendaUIStore((s) => s.sidebarCollapsed)
const setSidebarCollapsed = useAgendaUIStore((s) => s.setSidebarCollapsed)
useLayoutEffect(() => {
if (!isMobile) setSidebarCollapsed(false)
}, [isMobile, setSidebarCollapsed])
useEffect(() => {
if (isMobile) setSidebarCollapsed(true)
}, [isMobile, setSidebarCollapsed])
return (
<AgendaRouteRootProvider routeRoot={routeRoot}>
<SuiteThemeShell>
<TooltipProvider delayDuration={400}>
<div
className="ultimail-app relative flex h-dvh flex-col overflow-hidden bg-app-canvas"
data-agenda-app
>
{isMobile && !sidebarCollapsed && (
<button
type="button"
aria-label="Fermer le menu"
className="absolute inset-0 z-40 bg-black/20"
onClick={() => setSidebarCollapsed(true)}
/>
)}
{children}
<AiChatPanel />
<ComposeIdentitiesSync />
<AgendaOrgPolicySync />
<AgendaQuickSettingsRoot />
</div>
</TooltipProvider>
</SuiteThemeShell>
</AgendaRouteRootProvider>
)
}