book viewer full screen

This commit is contained in:
Hamid
2026-05-17 01:50:20 -07:00
parent 642155661c
commit 4390937b19
9 changed files with 164 additions and 55 deletions
@@ -0,0 +1,16 @@
import { useEffect } from 'react';
import { exitViewerFullscreen } from '@/pages/viewer/utils/viewerFullscreen';
type Options = {
enabled: boolean;
};
/** Leaves browser fullscreen when the viewer route unmounts. */
export function useBrowserFullscreen({ enabled }: Options) {
useEffect(() => {
if (!enabled) return;
return () => {
exitViewerFullscreen();
};
}, [enabled]);
}