components/Stage/stageOrientation.jsjavascript
import { createContext, useContext } from "react";
/**
* The orientation Stage actually renders in ("portrait" | "landscape") -
* already resolved for `orientation: "auto"` modes (Rad Enablement), so it
* flips live when an iPad is rotated. Provided by Stage.jsx; lets components
* pick orientation-specific assets (e.g. Screensaver.jsx's video) from the
* same decision that sizes the stage box, rather than from a separate
* `@media (orientation)` query against the real, unscaled window.
*/
export const StageOrientationContext = createContext("landscape");
/**
* @returns {"portrait"|"landscape"}
*/
export const useStageOrientation = () => useContext(StageOrientationContext);