Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missions conditional components #39

Merged
merged 2 commits into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/assets/styles/Missions.css
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@
text-transform: uppercase;
}

.missions-table .active-member .mission-status {
.missions-table .mission-status .active-member {
text-transform: capitalize;
}
19 changes: 15 additions & 4 deletions src/components/MissionItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,24 @@ const MissionItem = ({ mission }) => {
return (
<tr>
<td className="mission-name">{ mission.mission_name }</td>
<td className="mission-description">{ mission.description}</td>
<td className="mission-description">{ mission.description }</td>
<td className="mission-status">
<span className="badge badge-gray">Not a member</span>
{
mission.reserved ? (
<span className="badge badge-blue active-member">Active member</span>
)
: (
<span className="badge badge-gray">Not a member</span>
)
}
</td>
<td className="mission-join-button">
<button type="button" className="btn btn-gray" onClick={handleClickAddReservedMission}>Join Mission</button>
<button type="button" className="btn btn-pink" onClick={handleClickLeaveMission}>Leave Mission</button>
{mission.reserved ? (
<button type="button" className="btn btn-pink" onClick={handleClickLeaveMission}>Leave Mission</button>
)
: (
<button type="button" className="btn btn-gray" onClick={handleClickAddReservedMission}>Join Mission</button>
)}
</td>
</tr>
);
Expand Down