From b74f83694b9186d968a726e923bae903ad74c649 Mon Sep 17 00:00:00 2001 From: carlobortolan Date: Mon, 13 Jan 2025 18:10:07 +0100 Subject: [PATCH] Add fullscreen state management to AppState --- src/state/AppState.ts | 3 +++ src/state/AppStateProvider.tsx | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/src/state/AppState.ts b/src/state/AppState.ts index 69975e9e..9dcde3ca 100644 --- a/src/state/AppState.ts +++ b/src/state/AppState.ts @@ -39,6 +39,9 @@ export interface AppStateContext { setShouldDebugImageFallbacks?: Dispatch> shouldShowBaselineGrid?: boolean setShouldShowBaselineGrid?: Dispatch> + // FULLSCREEN + isFullscreen?: boolean + setIsFullscreen?: Dispatch> } export const AppStateContext = createContext({}); diff --git a/src/state/AppStateProvider.tsx b/src/state/AppStateProvider.tsx index 8a8f1da8..5e527c74 100644 --- a/src/state/AppStateProvider.tsx +++ b/src/state/AppStateProvider.tsx @@ -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}