Some checks are pending
E2E / Playwright e2e (push) Waiting to run
- Replaced suite page metadata with drive-specific metadata for document and drawing editors. - Introduced new `driveEditorPageMetadata` function to manage titles and favicons based on editor type. - Updated layout components for document and drawing editors to utilize the new metadata structure. - Enhanced document title handling in various editor components to reflect the current editing context. - Added new SVG icons for UltiDocs, UltiSheets, UltiSlides, and UltiDraw to improve visual consistency across editors. - Improved print styles and layout handling for better document rendering in print and PDF formats.
21 lines
563 B
TypeScript
21 lines
563 B
TypeScript
"use client"
|
|
|
|
import { useEffect } from "react"
|
|
import {
|
|
applyDriveEditorFavicon,
|
|
driveEditorDocumentTitle,
|
|
type DriveEditorKind,
|
|
} from "@/lib/drive/drive-editor-metadata"
|
|
|
|
export function useDriveDocumentTitle(titleSegment: string, kind: DriveEditorKind) {
|
|
useEffect(() => {
|
|
const previousTitle = document.title
|
|
document.title = driveEditorDocumentTitle(titleSegment, kind)
|
|
const restoreFavicon = applyDriveEditorFavicon(kind)
|
|
return () => {
|
|
document.title = previousTitle
|
|
restoreFavicon()
|
|
}
|
|
}, [titleSegment, kind])
|
|
}
|