ultisuite-client/components/drive/drive-app-shell.tsx
R3D347HR4Y 6ec95262af Add OnlyOffice integration and update project configurations
- Updated .env.example to include configuration for OnlyOffice Document Server.
- Modified the workspace configuration to remove the drive-suite path.
- Adjusted TypeScript environment imports for consistency.
- Enhanced Next.js configuration to disable canvas in Webpack.
- Updated package.json to include new dependencies for OnlyOffice and PDF.js.
- Added global styles for OnlyOffice theme integration in the CSS.
- Created new layout and page components for the Drive feature, including public sharing and editing functionalities.
- Updated metadata handling across various layouts to reflect the new app structure.
2026-06-07 15:49:21 +02:00

44 lines
1.6 KiB
TypeScript

"use client"
import { useEffect, useLayoutEffect, type ReactNode } from "react"
import { DriveSidebar } from "@/components/drive/drive-sidebar"
import { FilePreviewDialog } from "@/components/drive/file-preview-dialog"
import { ShareDialog } from "@/components/drive/share-dialog"
import { SuiteThemeShell } from "@/components/suite/suite-theme-shell"
import { useIsMobile } from "@/hooks/use-mobile"
import { useDriveUIStore } from "@/lib/stores/drive-ui-store"
export function DriveAppShell({ children }: { children: ReactNode }) {
const isMobile = useIsMobile()
const sidebarCollapsed = useDriveUIStore((s) => s.sidebarCollapsed)
const setSidebarCollapsed = useDriveUIStore((s) => s.setSidebarCollapsed)
const sidebarOpen = !sidebarCollapsed
useLayoutEffect(() => {
if (!isMobile) setSidebarCollapsed(false)
}, [isMobile, setSidebarCollapsed])
useEffect(() => {
if (isMobile) setSidebarCollapsed(true)
}, [isMobile, setSidebarCollapsed])
return (
<SuiteThemeShell>
<div className="ultimail-app relative flex h-dvh overflow-hidden bg-app-canvas" data-drive-app>
{isMobile && sidebarOpen && (
<button
type="button"
aria-label="Fermer le menu"
className="absolute inset-0 z-40 bg-black/20"
onClick={() => setSidebarCollapsed(true)}
/>
)}
<DriveSidebar overlay={isMobile} open={sidebarOpen} />
<div className="flex min-w-0 flex-1 flex-col bg-app-canvas" data-drive-main-column>{children}</div>
<ShareDialog />
<FilePreviewDialog />
</div>
</SuiteThemeShell>
)
}