fix(17): WR-05 IN-03 IN-01 resize-aware useIsPhone hook; OidcRedirect side-effect in effect

This commit is contained in:
Lucas Berger
2026-06-18 13:40:00 -04:00
parent c2ceebf130
commit a4a7438641
6 changed files with 73 additions and 25 deletions
+2 -5
View File
@@ -55,6 +55,7 @@ import { SyncStateToast } from './SyncStateToast.js';
import { ColorLegend } from './ColorLegend.js';
import { SkeletonCalendar } from './SkeletonCalendar.js';
import { InstallPrompt } from './InstallPrompt.js';
import { useIsPhone } from '../hooks/useIsPhone.js';
// ── Helpers ────────────────────────────────────────────────────────────────
@@ -71,10 +72,6 @@ function resolveDefaultView(persistedView: string): string {
return persistedView;
}
function isPhone(): boolean {
return typeof window !== 'undefined' && window.matchMedia('(max-width: 767px)').matches;
}
// ── Component ──────────────────────────────────────────────────────────────
export function CalendarShell() {
@@ -249,7 +246,7 @@ export function CalendarShell() {
const isInitialLoading = eventsQuery.isLoading && !eventsQuery.data;
const isEventsError = eventsQuery.isError;
const phone = isPhone();
const phone = useIsPhone();
// ── Auth splash (D-10) ────────────────────────────────────────────────────
// Gate the calendar render on auth state so no calendar shell, skeleton, or