Files
SixFlagsSuperCalendar/components/MobileCardList.tsx
josh e48038c399
Some checks failed
Build and Deploy / Build & Push (push) Failing after 22s
feat: UI redesign with park detail pages and ride status
Visual overhaul:
- Warmer color system with amber accent for Today, better text hierarchy
- Row hover highlighting, sticky column shadow on horizontal scroll
- Closed cells replaced with dot (·) instead of "Closed" text
- Regional grouping (Northeast/Southeast/Midwest/Texas & South/West)
- Two-row header with park count badge and WeekNav on separate lines
- Amber "Today" button in WeekNav when off current week
- Mobile card layout (< 1024px) with 7-day grid per park; table on desktop
- Skeleton loading state via app/loading.tsx

Park detail pages (/park/[id]):
- Month calendar view with ← → navigation via ?month= param
- Live ride status fetched from Six Flags API (cached 1h)
- Ride hours only shown when they differ from park operating hours
- Fallback to nearest upcoming open day when today is dropped by API,
  including cross-month fallback for end-of-month edge case

Data layer:
- Park type gains region field; parks.ts exports groupByRegion()
- db.ts gains getParkMonthData() for single-park month queries
- sixflags.ts gains scrapeRidesForDay() returning RidesFetchResult
  with rides, dataDate, isExact, and parkHoursLabel

Removed: CalendarGrid.tsx, MonthNav.tsx (dead code)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 11:53:06 -04:00

61 lines
1.7 KiB
TypeScript

import type { Park } from "@/lib/scrapers/types";
import type { DayData } from "@/lib/db";
import type { Region } from "@/lib/parks";
import { ParkCard } from "./ParkCard";
interface MobileCardListProps {
grouped: Map<Region, Park[]>;
weekDates: string[];
data: Record<string, Record<string, DayData>>;
today: string;
}
export function MobileCardList({ grouped, weekDates, data, today }: MobileCardListProps) {
return (
<div style={{ display: "flex", flexDirection: "column", gap: 24, paddingTop: 16 }}>
{Array.from(grouped.entries()).map(([region, parks]) => (
<div key={region} data-region={region}>
{/* Region heading */}
<div style={{
display: "flex",
alignItems: "center",
gap: 10,
marginBottom: 10,
paddingLeft: 2,
}}>
<div style={{
width: 3,
height: 14,
borderRadius: 2,
background: "var(--color-region-accent)",
flexShrink: 0,
}} />
<span style={{
fontSize: "0.65rem",
fontWeight: 700,
letterSpacing: "0.1em",
textTransform: "uppercase",
color: "var(--color-text-muted)",
}}>
{region}
</span>
</div>
{/* Park cards */}
<div style={{ display: "flex", flexDirection: "column", gap: 8 }}>
{parks.map((park) => (
<ParkCard
key={park.id}
park={park}
weekDates={weekDates}
parkData={data[park.id] ?? {}}
today={today}
/>
))}
</div>
</div>
))}
</div>
);
}