-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from NitBravoA92/rockets-filter
Rockets filter
- Loading branch information
Showing
4 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.services-content { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
gap: 2rem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import PropTypes from 'prop-types'; | ||
|
||
const ReservationItem = ({ serviceName }) => ( | ||
<li className="reservation-item"> | ||
{serviceName} | ||
</li> | ||
); | ||
|
||
ReservationItem.propTypes = { | ||
serviceName: PropTypes.string.isRequired, | ||
}; | ||
|
||
export default ReservationItem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { useSelector } from 'react-redux'; | ||
import ReservationItem from './ReservationItem'; | ||
|
||
const ReservedRockets = () => { | ||
const { rockets } = useSelector((state) => state.rockets); | ||
|
||
return ( | ||
<div className="my-rockets service"> | ||
<h2>My Rockets</h2> | ||
<ul id="reserved-rockets" className="reservation-list"> | ||
{rockets | ||
.filter((rocket) => rocket.reserved === true) | ||
.map((rocket) => ( | ||
<ReservationItem key={rocket.id} serviceName={rocket.name} /> | ||
))} | ||
</ul> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ReservedRockets; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters