Landscape: whole-app landscape-first + Home 2-column landscape layout
- Move orientation lock + RotatePrompt to app root → whole app is landscape- first now (UNO-style), not just the game. Generalized rotate copy. - Home: portrait unchanged; in landscape it becomes a 2-column app layout (col A = branding + play actions, col B = tiles + footer) that fits the short height with no scroll (landscape: Tailwind variants, overflow-hidden). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,6 @@ import { useEffect, useRef, useState } from "react";
|
||||
import { GameTable } from "@/components/GameTable";
|
||||
import { PostMatchRewardsModal } from "@/components/online/PostMatchRewardsModal";
|
||||
import { MatchIntroOverlay } from "@/components/online/MatchIntroOverlay";
|
||||
import { RotatePrompt } from "@/components/online/RotatePrompt";
|
||||
import { useGameStore } from "@/lib/game-store";
|
||||
import { useSessionStore } from "@/lib/session-store";
|
||||
import { useUIStore } from "@/lib/ui-store";
|
||||
@@ -59,20 +58,6 @@ export function GameScreen() {
|
||||
};
|
||||
}, []);
|
||||
|
||||
// Landscape-first table: best-effort lock to landscape on Android/PWA (iOS &
|
||||
// desktop reject it — harmless). Restored to portrait/auto when leaving.
|
||||
useEffect(() => {
|
||||
const o = (screen as unknown as { orientation?: { lock?: (m: string) => Promise<void>; unlock?: () => void } }).orientation;
|
||||
o?.lock?.("landscape").catch(() => {});
|
||||
return () => {
|
||||
try {
|
||||
o?.unlock?.();
|
||||
} catch {
|
||||
/* unsupported — ignore */
|
||||
}
|
||||
};
|
||||
}, []);
|
||||
|
||||
const notifyAchievements = (r: RewardResult) => {
|
||||
for (const a of r.newAchievements)
|
||||
pushNotification({
|
||||
@@ -157,9 +142,6 @@ export function GameScreen() {
|
||||
onForfeit={canForfeit ? () => useGameStore.getState().forfeit() : undefined}
|
||||
/>
|
||||
|
||||
{/* Landscape-first: nudge to rotate when held in portrait on a phone */}
|
||||
<RotatePrompt />
|
||||
|
||||
{/* UNO-style "players joining the table" intro (online matches, once) */}
|
||||
<AnimatePresence>
|
||||
{introPending && mode === "online" && (
|
||||
|
||||
Reference in New Issue
Block a user