Skip to content

Commit

Permalink
add 90 min option, hide stale reservations, expose next hour midday
Browse files Browse the repository at this point in the history
  • Loading branch information
jgravois committed Jun 24, 2024
1 parent 4a5114a commit 614a8fc
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
14 changes: 12 additions & 2 deletions app/routes/faq.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,21 @@ export default function FAQ() {
<a className="oldschool-link" href="https://github.com/mel-thomas">
@mel-thomas
</a>
&nbsp;🎨. icons courtesy of&nbsp;
&nbsp;🎨
</p>
<p className="faq-a">
{" "}
icons courtesy of&nbsp;
<a className="oldschool-link" href="https://fontawesome.com/">
font awesome
</a>
.
, image courtesy of&nbsp;
<a
className="oldschool-link"
href="https://unsplash.com/photos/silhouette-photo-of-basketball-system-57rD2oDZquc"
>
@nicholasjio/unsplash
</a>
</p>
</main>
</>
Expand Down
8 changes: 6 additions & 2 deletions app/routes/reservation-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ const TimeSlots = ({
})}
>
{rezTimes.map((num) => {
const isPast = num <= offsetNow.getHours() + 1 && isToday;
const isPast = num <= offsetNow.getHours() && isToday;
const isJustPast = num === offsetNow.getHours() && isToday;

const onHourPrivate = reservations.find(
(r) => isOverlapping(r, date, num) && !r.openPlay,
Expand All @@ -82,7 +83,10 @@ const TimeSlots = ({
const onHourIsReserved = onHourPrivate || onHourOpenPlay;
const halfHourIsReserved = halfHourPrivate || halfHourOpenPlay;

if (isPast && !onHourIsReserved && !halfHourIsReserved) {
if (
isPast &&
!(isJustPast && (onHourIsReserved || halfHourIsReserved))
) {
return null;
}

Expand Down
10 changes: 10 additions & 0 deletions app/routes/reservations.new.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,16 @@ export default function NewReservationPage() {
/>
<span className="newRes_checkmark"></span>
</label>
<label htmlFor="duration90" className="newRes_radio">
90 minutes
<input
type="radio"
id="duration90"
name="duration"
value="90"
/>
<span className="newRes_checkmark"></span>
</label>
<label htmlFor="duration120" className="newRes_radio">
2 hours
<input
Expand Down
Binary file added flyer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 614a8fc

Please sign in to comment.