Some checks are pending
E2E / Playwright e2e (push) Waiting to run
- 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.
31 lines
716 B
TypeScript
31 lines
716 B
TypeScript
"use client"
|
|
|
|
import { createContext, useContext, type ReactNode } from "react"
|
|
|
|
export const DEFAULT_DRIVE_ROUTE_ROOT = "drive"
|
|
|
|
const DriveRouteRootContext = createContext(DEFAULT_DRIVE_ROUTE_ROOT)
|
|
|
|
export function DriveRouteRootProvider({
|
|
routeRoot = DEFAULT_DRIVE_ROUTE_ROOT,
|
|
children,
|
|
}: {
|
|
routeRoot?: string
|
|
children: ReactNode
|
|
}) {
|
|
return (
|
|
<DriveRouteRootContext.Provider value={routeRoot}>
|
|
{children}
|
|
</DriveRouteRootContext.Provider>
|
|
)
|
|
}
|
|
|
|
export function useDriveRouteRoot(): string {
|
|
return useContext(DriveRouteRootContext)
|
|
}
|
|
|
|
/** Demo shell may override route root via context provider. */
|
|
export function useDriveRouteRootFromDemo(): string {
|
|
return useDriveRouteRoot()
|
|
}
|