feat: show open dot based on hours, Weather Delay when queue-times shows 0 rides
All checks were successful
Build and Deploy / Build & Push (push) Successful in 49s
All checks were successful
Build and Deploy / Build & Push (push) Successful in 49s
Park open indicator now derives from scheduled hours, not ride counts. Parks with queue-times coverage but 0 open rides (e.g. storm) show a "⛈ Weather Delay" notice instead of a ride count on both desktop and mobile. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -12,7 +12,9 @@ interface WeekCalendarProps {
|
||||
grouped?: Map<Region, Park[]>; // pre-grouped parks (if provided, renders region headers)
|
||||
rideCounts?: Record<string, number>; // parkId → open ride/coaster count for today
|
||||
coastersOnly?: boolean;
|
||||
closingParkIds?: string[]; // parks in the post-close wind-down buffer
|
||||
openParkIds?: string[];
|
||||
closingParkIds?: string[];
|
||||
weatherDelayParkIds?: string[];
|
||||
}
|
||||
|
||||
const DOW = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
||||
@@ -189,7 +191,9 @@ function ParkRow({
|
||||
parkData,
|
||||
rideCounts,
|
||||
coastersOnly,
|
||||
openParkIds,
|
||||
closingParkIds,
|
||||
weatherDelayParkIds,
|
||||
}: {
|
||||
park: Park;
|
||||
parkIdx: number;
|
||||
@@ -198,11 +202,15 @@ function ParkRow({
|
||||
parkData: Record<string, DayData>;
|
||||
rideCounts?: Record<string, number>;
|
||||
coastersOnly?: boolean;
|
||||
openParkIds?: string[];
|
||||
closingParkIds?: string[];
|
||||
weatherDelayParkIds?: string[];
|
||||
}) {
|
||||
const rowBg = parkIdx % 2 === 0 ? "var(--color-bg)" : "var(--color-surface)";
|
||||
const tzAbbr = getTimezoneAbbr(park.timezone);
|
||||
const isOpen = openParkIds?.includes(park.id) ?? false;
|
||||
const isClosing = closingParkIds?.includes(park.id) ?? false;
|
||||
const isWeatherDelay = weatherDelayParkIds?.includes(park.id) ?? false;
|
||||
return (
|
||||
<tr
|
||||
className="park-row"
|
||||
@@ -232,7 +240,7 @@ function ParkRow({
|
||||
<span style={{ fontWeight: 500, fontSize: "0.85rem", lineHeight: 1.2, color: "var(--color-text)", whiteSpace: "nowrap" }}>
|
||||
{park.name}
|
||||
</span>
|
||||
{rideCounts?.[park.id] !== undefined && (
|
||||
{isOpen && (
|
||||
<span style={{
|
||||
width: 7,
|
||||
height: 7,
|
||||
@@ -249,7 +257,12 @@ function ParkRow({
|
||||
{park.location.city}, {park.location.state}
|
||||
</div>
|
||||
</div>
|
||||
{rideCounts?.[park.id] !== undefined && (
|
||||
{isWeatherDelay && (
|
||||
<div style={{ fontSize: "0.7rem", color: "var(--color-text-muted)", fontWeight: 500, textAlign: "right" }}>
|
||||
⛈ Weather Delay
|
||||
</div>
|
||||
)}
|
||||
{!isWeatherDelay && rideCounts?.[park.id] !== undefined && (
|
||||
<div style={{ fontSize: "0.72rem", color: isClosing ? "var(--color-closing-hours)" : "var(--color-open-hours)", fontWeight: 600, textAlign: "right" }}>
|
||||
{rideCounts[park.id]} {coastersOnly
|
||||
? (rideCounts[park.id] === 1 ? "coaster" : "coasters")
|
||||
@@ -271,7 +284,7 @@ function ParkRow({
|
||||
);
|
||||
}
|
||||
|
||||
export function WeekCalendar({ parks, weekDates, data, grouped, rideCounts, coastersOnly, closingParkIds }: WeekCalendarProps) {
|
||||
export function WeekCalendar({ parks, weekDates, data, grouped, rideCounts, coastersOnly, openParkIds, closingParkIds, weatherDelayParkIds }: WeekCalendarProps) {
|
||||
const today = getTodayLocal();
|
||||
const parsedDates = weekDates.map(parseDate);
|
||||
|
||||
@@ -387,7 +400,9 @@ export function WeekCalendar({ parks, weekDates, data, grouped, rideCounts, coas
|
||||
parkData={data[park.id] ?? {}}
|
||||
rideCounts={rideCounts}
|
||||
coastersOnly={coastersOnly}
|
||||
openParkIds={openParkIds}
|
||||
closingParkIds={closingParkIds}
|
||||
weatherDelayParkIds={weatherDelayParkIds}
|
||||
/>
|
||||
))}
|
||||
</Fragment>
|
||||
|
||||
Reference in New Issue
Block a user