Skip to content

Commit

Permalink
Add missions to profile
Browse files Browse the repository at this point in the history
  • Loading branch information
mershark committed Sep 7, 2023
1 parent e10b5f3 commit e32bcc9
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/components/Profile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,27 @@ function Profile() {
const { rockets } = useSelector((state) => state.rockets);
const reservedRockets = rockets.filter((rocket) => rocket.reserved);

const { missions } = useSelector((state) => state.missions);
const joinedMission = missions.filter((mission) => mission.join);

return (
<div className="profile">
<div className="mission">
<h2>My Missions</h2>

{ joinedMission.length > 0 ? (
<div className="mission-list">
{
joinedMission.map((mission) => (
<p
key={mission.mission_id}
className="profile-list"
>
{mission.mission_name}
</p>
))
}
</div>
) : <p className="notExist">There is no joined mission.</p>}
</div>

<div className="rockets">
Expand Down

0 comments on commit e32bcc9

Please sign in to comment.