Skip to content

Commit

Permalink
Revert "Revert ".""
Browse files Browse the repository at this point in the history
This reverts commit ca4fc9a.
  • Loading branch information
Ayroid committed Dec 12, 2023
1 parent ca4fc9a commit 3601b5e
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions src/components/Home/ConfirmParkingButton/ConfirmParkingButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,25 @@ const ConfirmParkingButton = ({
</div>
</div>
</div>
{!userAlreadyBooked && currentlyParkedUser == null && (
<button
className={bookingButton}
onClick={() => bookSpot(parkingNumber)}
>
Book Now
</button>
)}
{parkingStatus === "booked" && user === currentlyParkedUser && (
<button
className={bookingButton}
onClick={() => cancelSpot(parkingNumber)}
>
Cancel Booking
</button>
)}
{!userAlreadyBooked &&
currentlyParkedUser == null &&
parkingStatus == "available" && (
<button
className={bookingButton}
onClick={() => bookSpot(parkingNumber)}
>
Book Now
</button>
)}
{(parkingStatus === "booked" || parkingStatus === "parked") &&
user === currentlyParkedUser && (
<button
className={bookingButton}
onClick={() => cancelSpot(parkingNumber)}
>
Cancel Booking
</button>
)}
</div>
);
};
Expand Down

0 comments on commit 3601b5e

Please sign in to comment.