feat: show live open ride count in park name cell
- Fetch Queue-Times ride counts for parks open today (5min cache) - Only shown within 1h before open to 1h after scheduled close - Count displayed on the right of the park name/location cell (desktop) and below the open badge (mobile) - Whole park cell is now a clickable link - Hover warms the park cell background; no row-wide highlight Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -7,11 +7,12 @@ interface ParkCardProps {
|
||||
weekDates: string[]; // 7 dates YYYY-MM-DD, Sun–Sat
|
||||
parkData: Record<string, DayData>;
|
||||
today: string;
|
||||
openRideCount?: number;
|
||||
}
|
||||
|
||||
const DOW = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
|
||||
|
||||
export function ParkCard({ park, weekDates, parkData, today }: ParkCardProps) {
|
||||
export function ParkCard({ park, weekDates, parkData, today, openRideCount }: ParkCardProps) {
|
||||
const openDays = weekDates.filter((d) => parkData[d]?.isOpen && parkData[d]?.hoursLabel);
|
||||
const isOpenToday = openDays.includes(today);
|
||||
|
||||
@@ -21,12 +22,11 @@ export function ParkCard({ park, weekDates, parkData, today }: ParkCardProps) {
|
||||
data-park={park.name.toLowerCase()}
|
||||
style={{ textDecoration: "none", display: "block" }}
|
||||
>
|
||||
<div style={{
|
||||
<div className="park-card" style={{
|
||||
background: "var(--color-surface)",
|
||||
border: "1px solid var(--color-border)",
|
||||
borderRadius: 12,
|
||||
overflow: "hidden",
|
||||
transition: "border-color 120ms ease",
|
||||
}}>
|
||||
{/* ── Card header ───────────────────────────────────────────────────── */}
|
||||
<div style={{
|
||||
@@ -54,6 +54,7 @@ export function ParkCard({ park, weekDates, parkData, today }: ParkCardProps) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style={{ display: "flex", flexDirection: "column", alignItems: "flex-end", gap: 5, flexShrink: 0 }}>
|
||||
{isOpenToday ? (
|
||||
<div style={{
|
||||
background: "var(--color-open-bg)",
|
||||
@@ -64,7 +65,6 @@ export function ParkCard({ park, weekDates, parkData, today }: ParkCardProps) {
|
||||
fontWeight: 700,
|
||||
color: "var(--color-open-text)",
|
||||
whiteSpace: "nowrap",
|
||||
flexShrink: 0,
|
||||
letterSpacing: "0.03em",
|
||||
}}>
|
||||
Open today
|
||||
@@ -79,11 +79,21 @@ export function ParkCard({ park, weekDates, parkData, today }: ParkCardProps) {
|
||||
fontWeight: 500,
|
||||
color: "var(--color-text-muted)",
|
||||
whiteSpace: "nowrap",
|
||||
flexShrink: 0,
|
||||
}}>
|
||||
Closed today
|
||||
</div>
|
||||
)}
|
||||
{isOpenToday && openRideCount !== undefined && (
|
||||
<div style={{
|
||||
fontSize: "0.65rem",
|
||||
color: "var(--color-open-hours)",
|
||||
fontWeight: 500,
|
||||
textAlign: "right",
|
||||
}}>
|
||||
{openRideCount} open
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* ── Open days list ────────────────────────────────────────────────── */}
|
||||
|
||||
Reference in New Issue
Block a user