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,12 +1,13 @@
|
||||
"use client";
|
||||
|
||||
import React, { useEffect, useMemo, useState } from "react";
|
||||
import React, { useMemo, useState } from "react";
|
||||
import { CheckSquare, X, Download } from "lucide-react";
|
||||
import { API_BASE } from "@/lib/api";
|
||||
import { errorMessage } from "@/lib/utils";
|
||||
import { downloadReportExcel } from "@/lib/export";
|
||||
import type { Event, Registration } from "@/types";
|
||||
import { apiV2Data } from "@/lib/apiV2";
|
||||
import { useExternalEffect } from "@/lib/hooks";
|
||||
|
||||
type Action = "" | "message" | "markPaid" | "moveOption" | "allocate" | "cancel" | "export";
|
||||
type Result = { id: string; ok: boolean; skipped?: boolean; message: string };
|
||||
@@ -54,7 +55,7 @@ export function RegistrationBulkBar({ selected, events, token, onClear, onDone }
|
||||
const options = useMemo(() => (oneEvent?.eventOptions || []).filter(o => o.id !== oneEvent?.kidsOptionId && o.id !== oneEvent?.volunteerOptionId), [oneEvent]);
|
||||
const totalOwing = useMemo(() => selected.filter(r => r.status !== "cancelled").reduce((s, r) => s + owing(r), 0), [selected]);
|
||||
|
||||
useEffect(() => {
|
||||
useExternalEffect(() => {
|
||||
if (action !== "allocate" || !oneEvent) { setSets([]); return; }
|
||||
(apiV2Data("get", "/events/{id}/allocations", { params: { id: oneEvent.id }, authToken: token }) as Promise<{ sets?: AllocationSet[] }>)
|
||||
.then(b => setSets((b.sets || []).filter(s => s.groups.length)))
|
||||
|
||||
Reference in New Issue
Block a user