Skip to content

Commit 6bc1376

Browse files
committed
removed Missions component #33
1 parent 9c8e936 commit 6bc1376

File tree

2 files changed

+20
-53
lines changed

2 files changed

+20
-53
lines changed

client/components/Missions.js

Lines changed: 0 additions & 46 deletions
This file was deleted.

client/components/Volunteer.js

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import _ from 'lodash';
33
import { Card, Alert, ButtonGroup, Button, Spinner } from 'elemental';
44
import VolunteerForm from './VolunteerForm';
55
import LoginLinkForm from './LoginLinkForm';
6-
import Missions from './Missions';
6+
import Mission from './Mission';
77
import * as http from '../lib/http';
88

99
export default React.createClass({
@@ -42,6 +42,20 @@ export default React.createClass({
4242
this.setState({ isEditing: !this.state.isEditing });
4343
},
4444

45+
renderMissions() {
46+
if (!this.state.missions) return null;
47+
48+
if (!this.state.missions.length) {
49+
return <p>You're not on any missions yet.</p>;
50+
}
51+
52+
return (
53+
<div>
54+
{this.state.missions.map(mission => <Mission key={mission.id} mission={mission} />)}
55+
</div>
56+
);
57+
},
58+
4559
render() {
4660
if (this.state.error) {
4761
return (
@@ -76,12 +90,11 @@ export default React.createClass({
7690
{!this.state.hasVisitedBefore && !this.state.isEditing &&
7791
<Alert type="info"><strong>Welcome!</strong> To edit your personal information, click on “<strong>Change Data</strong>” ↗</Alert>
7892
}
79-
<Card>
80-
{this.state.isEditing
81-
? <VolunteerForm volunteer={this.state.volunteer} onChange={this.setVolunteer} />
82-
: <Missions missions={this.state.missions} />
83-
}
84-
</Card>
93+
94+
{this.state.isEditing
95+
? <VolunteerForm volunteer={this.state.volunteer} onChange={this.setVolunteer} />
96+
: this.renderMissions()
97+
}
8598
</div>
8699
);
87100
},

0 commit comments

Comments
 (0)