mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-05-11 04:01:34 +00:00
Introduce a single, app-root-owned source of truth for fullscreen state, mirroring the existing provider pattern (ToastProvider, FileDropProvider). The provider centralizes the fullscreenchange / win-visibility-changed / keydown listeners and exposes the same [fullscreen, requestFullscreen, exitFullscreen, toggleFullscreen] tuple that consumers already destructure. Not yet wired up - both the legacy src/common/useFullscreen hook and the new module coexist. Subsequent commits mount the provider in App.js and switch consumers over. Made-with: Cursor
8 lines
229 B
TypeScript
8 lines
229 B
TypeScript
// Copyright (C) 2017-2023 Smart code 203358507
|
|
|
|
import { useContext } from 'react';
|
|
import FullscreenContext from './FullscreenContext';
|
|
|
|
const useFullscreen = () => useContext(FullscreenContext);
|
|
|
|
export default useFullscreen;
|