Add fullscreen state management to AppState

This commit is contained in:
carlobortolan 2025-01-13 18:10:07 +01:00
parent 2cc632143e
commit b74f83694b
No known key found for this signature in database
GPG Key ID: 574D9F10F0EED1BE
2 changed files with 9 additions and 0 deletions

View File

@ -39,6 +39,9 @@ export interface AppStateContext {
setShouldDebugImageFallbacks?: Dispatch<SetStateAction<boolean>>
shouldShowBaselineGrid?: boolean
setShouldShowBaselineGrid?: Dispatch<SetStateAction<boolean>>
// FULLSCREEN
isFullscreen?: boolean
setIsFullscreen?: Dispatch<SetStateAction<boolean>>
}
export const AppStateContext = createContext<AppStateContext>({});

View File

@ -52,6 +52,9 @@ export default function AppStateProvider({
useState(false);
const [shouldShowBaselineGrid, setShouldShowBaselineGrid] =
useState(false);
// FULLSCREEN
const [isFullscreen, setIsFullscreen] =
useState(false);
const invalidateSwr = useCallback(() => setSwrTimestamp(Date.now()), []);
@ -120,6 +123,9 @@ export default function AppStateProvider({
setShouldDebugImageFallbacks,
shouldShowBaselineGrid,
setShouldShowBaselineGrid,
// FULLSCREEN
isFullscreen,
setIsFullscreen,
}}
>
{children}