diff --git a/app/src/screens/StartSessionScreen.tsx b/app/src/screens/StartSessionScreen.tsx index 3e48b1e..3b44c6a 100644 --- a/app/src/screens/StartSessionScreen.tsx +++ b/app/src/screens/StartSessionScreen.tsx @@ -51,6 +51,13 @@ export function StartSessionScreen() { const { zone } = useRoute().params; const space = zone.Spaces?.[0]; + // The policy in effect right now (CurrentSlot). Drives whether paid parking is + // even applicable — some windows are Free or No Parking (per the meter's schedule). + const currentPolicy = space?.Policies?.find((p) => p.CurrentSlot); + const currentType = (currentPolicy?.RateType ?? '').toLowerCase(); + const currentlyFree = currentType.includes('free'); + const noParkingNow = currentType.includes('no parking'); + const [vehicles, setVehicles] = useState([]); const [cards, setCards] = useState([]); const [vehicleId, setVehicleId] = useState(); @@ -169,6 +176,32 @@ export function StartSessionScreen() { } }; + // When the current time-of-day policy is Free or No Parking, paid parking + // doesn't apply — show the status instead of a purchase flow (matches the app). + if (currentlyFree || noParkingNow) { + return ( + + {zone.ZoneName} + + + {currentlyFree ? 'Parking is currently free' : 'No parking allowed right now'} + + {currentPolicy?.MessageText && currentPolicy.MessageText !== 'null' ? ( + {currentPolicy.MessageText} + ) : null} + {currentPolicy?.DisplayString ? ( + {currentPolicy.DisplayString} + ) : null} + + + ); + } + if (loading && !ladder.length) { return (