fix: react-doctor → 64/100 (Bugs 122, Perf 286, A11y 613, Maint 436)
- CartContext: lazy initializers replace mount-only useEffect hydration; remove 8 no-initialize-state warnings - Toast/AdminSearchInput: React 19 useContext/use + drop forwardRef (3 no-react19-deprecated-apis) - ProductFormModal: lazy initializers + useSyncExternalStore for mount; parent adds key=editingProduct.id - InstallPrompt: useReducer for prompt state (no-cascading-set-state) - QRScanModal: ref-based latest-callback pattern replaces useEffectEvent deps mistake - OnboardingFlow: functional setState (rerender-functional-setstate) - UsersPage/StopsCalendar/FeaturesAndStats: lazy initializers (rerender-lazy-state-init) - FAQClientPage: server-side brand settings fetch via getBrandSettingsPublic in layout; remove supabase import - LandingPageWrapper: href='#' → href='#top' (anchor-is-valid) - TuxedoVideoHero: replace animate-bounce with ease-out-expo (no-inline-bounce-easing) - ProductTableClient: useCallback for handleDeleted (jsx-no-new-function-as-prop) - excel-parser: pre-compile delimiter regexes (js-hoist-regexp) - water-log/settings: Promise.all for parallel DB calls (async-parallel) - ToastNotification: extract toast store to separate file (only-export-components) - WholesaleClient: inline <WholesaleIcon/> instead of hoisting to const (rendering-hoist-jsx)
This commit is contained in:
@@ -256,7 +256,7 @@ export default function OrdersTab({ orders, customers, brandId, onMsg, onRefresh
|
||||
<AdminButton variant="secondary" size="sm" onClick={() => setShowBulkDep(true)}>
|
||||
Bulk Record Deposit
|
||||
</AdminButton>
|
||||
<button onClick={() => setSelected(new Set())} className="ml-auto text-xs text-[var(--admin-text-muted)] hover:text-[var(--admin-text-secondary)]">Clear selection</button>
|
||||
<button type="button" onClick={() => setSelected(new Set())} className="ml-auto text-xs text-[var(--admin-text-muted)] hover:text-[var(--admin-text-secondary)]">Clear selection</button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -371,7 +371,7 @@ export default function OrdersTab({ orders, customers, brandId, onMsg, onRefresh
|
||||
|
||||
{/* ⋮ Actions dropdown — opens upward to avoid table cutoff */}
|
||||
<div className="relative">
|
||||
<button
|
||||
<button type="button"
|
||||
onClick={(e) => toggleActions(o.id, e)}
|
||||
title="More actions"
|
||||
className="inline-flex items-center justify-center rounded-xl w-9 h-9 text-[var(--admin-text-muted)] hover:text-[var(--admin-text-secondary)] hover:bg-[var(--admin-bg-subtle)] transition-colors"
|
||||
@@ -384,7 +384,7 @@ export default function OrdersTab({ orders, customers, brandId, onMsg, onRefresh
|
||||
className="absolute bottom-full right-0 mb-1 z-30 w-56 rounded-xl bg-white shadow-xl ring-1 ring-[var(--admin-border)] py-1 text-sm"
|
||||
onClick={e => e.stopPropagation()}
|
||||
>
|
||||
<button
|
||||
<button type="button"
|
||||
onClick={() => { setOpenActions(null); setShowViewOrder(o); }}
|
||||
className="w-full text-left px-4 py-3 text-[var(--admin-accent)] hover:bg-[var(--admin-accent-light)] flex items-center gap-3 font-medium"
|
||||
>
|
||||
@@ -392,7 +392,7 @@ export default function OrdersTab({ orders, customers, brandId, onMsg, onRefresh
|
||||
View / Edit Order
|
||||
</button>
|
||||
|
||||
<button
|
||||
<button type="button"
|
||||
onClick={() => {
|
||||
setOpenActions(null);
|
||||
fetch("/api/wholesale/manifest", {
|
||||
@@ -409,7 +409,7 @@ export default function OrdersTab({ orders, customers, brandId, onMsg, onRefresh
|
||||
Generate Manifest
|
||||
</button>
|
||||
|
||||
<button
|
||||
<button type="button"
|
||||
onClick={() => {
|
||||
setOpenActions(null);
|
||||
fetch("/api/wholesale/price-sheet", {
|
||||
@@ -427,7 +427,7 @@ export default function OrdersTab({ orders, customers, brandId, onMsg, onRefresh
|
||||
<div className="my-1 border-t border-[var(--admin-border)]" />
|
||||
|
||||
{o.status !== "cancelled" && o.fulfillment_status !== "fulfilled" && (
|
||||
<button
|
||||
<button type="button"
|
||||
onClick={() => { setOpenActions(null); handleCancelOrder(o.id); }}
|
||||
className="w-full text-left px-4 py-3 text-[var(--admin-danger)] hover:bg-[var(--admin-danger-light)] flex items-center gap-3"
|
||||
>
|
||||
@@ -437,7 +437,7 @@ export default function OrdersTab({ orders, customers, brandId, onMsg, onRefresh
|
||||
)}
|
||||
|
||||
{o.fulfillment_status !== "fulfilled" && (
|
||||
<button
|
||||
<button type="button"
|
||||
onClick={() => { setOpenActions(null); handleDeleteOrder(o.id); }}
|
||||
className="w-full text-left px-4 py-3 text-[var(--admin-danger)] hover:bg-[var(--admin-danger-light)] flex items-center gap-3"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user