enoqueJonas / space-travelers

A front-end web application that displays SpaceX Rockets using their API. Users can rent their favorite rockets and register for SpaceX missions. Built with React.
1 stars 0 forks source link

[1pt] Switch badges for Rockets - Conditional components #5

Open enoqueJonas opened 1 year ago

enoqueJonas commented 1 year ago

Rockets that have already been reserved should show a "Reserved" badge and "Cancel reservation" button instead of the default "Reserve rocket" (as per design)

Use the React conditional rendering syntax:

{rocket.reserved && ( 
    // render Cancel Rocket button
)}