Skip to content

Commit

Permalink
Merge pull request #31 from HENRYKC24/joined-missions-profile
Browse files Browse the repository at this point in the history
Add missions profile
  • Loading branch information
vikitaotiz authored Oct 6, 2021
2 parents 8bac814 + 945d1c2 commit a05e8b3
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
17 changes: 17 additions & 0 deletions src/components/MyMissionProfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { useSelector } from 'react-redux';

const MyMissionProfile = () => {
const missions = useSelector((state) => state.missions.filter((mission) => mission.joined));

return (
<div>
<ul className="profile-missions">
{missions.length > 0 ? missions.map((mission) => (
<li key={mission.id} mission={mission}><b>{mission.name}</b></li>
)) : 'No Mission Joined'}
</ul>
</div>
);
};

export default MyMissionProfile;
8 changes: 7 additions & 1 deletion src/pages/MyProfile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import React from 'react';
import ReservedRockets from './ReservedRockets';
import MyMissionProfile from '../components/MyMissionProfile';

const MyProfile = () => <div><ReservedRockets /></div>;
const MyProfile = () => (
<div>
<MyMissionProfile />
<ReservedRockets />
</div>
);

export default MyProfile;
18 changes: 18 additions & 0 deletions src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,24 @@ tbody > tr:nth-child(even) { background: #fff; }
padding: 10px;
}

.profile-missions {
border: 1px solid #ccc;
border-radius: 5px;
list-style: none;
padding: 0;
margin: 2%;
list-style-position: inside;
}

.profile-missions li {
border-bottom: 1px solid #ccc;
padding: 1%;
}

.profile-missions li:last-child {
border-bottom: none;
}

@media screen and (max-width: 900px) {
.table-row {
display: flex;
Expand Down

0 comments on commit a05e8b3

Please sign in to comment.