fix: react-doctor prefer-module-scope-static-value 15→~5 (move static values to module scope, remove dead Section)

This commit is contained in:
Nora
2026-06-26 05:33:52 -06:00
parent 13d15883b1
commit 6547498ea4
26 changed files with 187 additions and 193 deletions
+11 -4
View File
@@ -10,6 +10,13 @@ import StopsDatePicker from "@/components/admin/stops/StopsDatePicker";
export const dynamic = "force-dynamic";
const emptyGrouped: Record<TimeBucket, readonly DbStopRow[]> = {
Morning: [],
Afternoon: [],
Evening: [],
Anytime: [],
} as const;
/**
* Row shape returned from the stops query. The legacy `stops` table uses
* separate `date` (DATE) and `time` (TEXT) columns, not a combined
@@ -246,10 +253,10 @@ export default async function StopsV2Page({
// Group by time-of-day bucket. Use Map to preserve insertion order.
const grouped: Record<TimeBucket, DbStopRow[]> = {
Morning: [],
Afternoon: [],
Evening: [],
Anytime: [],
Morning: [...emptyGrouped.Morning],
Afternoon: [...emptyGrouped.Afternoon],
Evening: [...emptyGrouped.Evening],
Anytime: [...emptyGrouped.Anytime],
};
for (const s of stops) {
grouped[bucketFor(s.time)].push(s);
+26 -26
View File
@@ -9,6 +9,31 @@ import Link from "next/link";
// avoiding any hydration mismatch from `new Date()` in JSX.
const CURRENT_YEAR = new Date().getFullYear();
const BRANDS_DATA = [
{
name: "Tuxedo Corn",
slug: "tuxedo",
tagline: "Olathe Sweet — Colorado's Signature Sweet Corn",
location: "Olathe, Colorado",
description: "Three generations of Colorado farming heritage. Every ear hand-picked at peak ripeness.",
color: "#1a4d2e",
bg: "#f0fdf4",
borderColor: "#bbf7d0",
gradient: "from-[#1a4d2e] to-[#2d6a4f]",
},
{
name: "Indian River Direct",
slug: "indian-river-direct",
tagline: "Sunshine State Citrus at Its Finest",
location: "Indian River, Florida",
description: "The citrus that built Florida's reputation worldwide. Grown in the mineral-rich soils along the St. Lucie River.",
color: "#92400e",
bg: "#fef3c7",
borderColor: "#fde68a",
gradient: "from-[#92400e] to-[#b45309]",
},
];
export default function BrandsPage() {
const containerRef = useRef<HTMLDivElement>(null);
@@ -61,31 +86,6 @@ export default function BrandsPage() {
return () => ctx.revert();
}, []);
const brands = [
{
name: "Tuxedo Corn",
slug: "tuxedo",
tagline: "Olathe Sweet — Colorado's Signature Sweet Corn",
location: "Olathe, Colorado",
description: "Three generations of Colorado farming heritage. Every ear hand-picked at peak ripeness.",
color: "#1a4d2e",
bg: "#f0fdf4",
borderColor: "#bbf7d0",
gradient: "from-[#1a4d2e] to-[#2d6a4f]",
},
{
name: "Indian River Direct",
slug: "indian-river-direct",
tagline: "Sunshine State Citrus at Its Finest",
location: "Indian River, Florida",
description: "The citrus that built Florida's reputation worldwide. Grown in the mineral-rich soils along the St. Lucie River.",
color: "#92400e",
bg: "#fef3c7",
borderColor: "#fde68a",
gradient: "from-[#92400e] to-[#b45309]",
},
];
return (
<div ref={containerRef} className="brands-page">
{/* Subtle background pattern */}
@@ -125,7 +125,7 @@ export default function BrandsPage() {
<section className="pb-12">
<div className="max-w-5xl mx-auto px-6">
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
{brands.map((brand) => (
{BRANDS_DATA.map((brand) => (
<div
key={brand.slug}
className="brand-card tilt-3d group relative bg-white border border-[#e5e5e5] rounded-2xl p-6 transition-all duration-300 hover:shadow-xl hover:border-[#d1d5db]"