WIP 2.0.0: React Compiler lint rules back to errors; docs
- The 192 places the rules flagged are fixed and the rules are errors again (npx eslint src: nothing). lib/hooks.ts: useStateSync (state that follows other state, set while rendering), useExternalEffect (API loads and browser reads), useNow; lib/navigation.ts hardNavigate for full reloads after sign-out or identity switches; other pages use the router. Resets moved into the handlers that cause them. - The banner shows and hides at its times on open pages. - HANDOVER, roadmap, README, FEATURES, SETTINGS, CHANGELOG updated; 2.0.0 section drafted in WHATS-NEW. e2e 102/102 (PayFast sandbox skipped); production build passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import React, { useCallback, useEffect, useState } from "react";
|
||||
import React, { useCallback, useState } from "react";
|
||||
import Link from "next/link";
|
||||
import { CalendarClock, ArrowRight, Baby, HandHeart, UserCheck, Banknote, Inbox, CheckCircle2 } from "lucide-react";
|
||||
import { useAuth } from "@/hooks/useAuth";
|
||||
@@ -8,6 +8,7 @@ import { useVisiblePolling } from "@/hooks/useVisiblePolling";
|
||||
import { CampusBadge } from "@/components/shared/CampusFilter";
|
||||
import type { Event } from "@/types";
|
||||
import { apiV2Data } from "@/lib/apiV2";
|
||||
import { useExternalEffect } from "@/lib/hooks";
|
||||
|
||||
type TodayEvent = {
|
||||
id: string; title: string; location: string | null; campus: Event["campus"]; isHidden: boolean; kidsCheckIn: boolean;
|
||||
@@ -37,7 +38,7 @@ export function TodayPanel({ supervisor }: { supervisor: boolean }) {
|
||||
if (!token) return;
|
||||
try { setData(await (apiV2Data("get", "/dashboard/today", { authToken: token }) as Promise<Today>)); } catch { /* keep what's shown */ }
|
||||
}, [token]);
|
||||
useEffect(() => { load(); }, [load]);
|
||||
useExternalEffect(() => { load(); }, [load]);
|
||||
useVisiblePolling(load, 30000, !!token);
|
||||
|
||||
if (!data) return null;
|
||||
|
||||
Reference in New Issue
Block a user