@@ -121,8 +121,9 @@ export default React.createClass({
121
121
const area = mission . area ? mission . area . name : '' ;
122
122
const position = this . state . position ;
123
123
const right = { float : 'right' } ;
124
- let headOfMission = this . context . volunteers [ this . props . mission . headOfMission ] || { } ;
125
- headOfMission = headOfMission . name ? `${ headOfMission . name . first } ${ headOfMission . name . last } ` : 'none yet' ;
124
+
125
+ let headOfMission = this . context . volunteers ? this . context . volunteers [ this . props . mission . headOfMission ] : { } ;
126
+ headOfMission = headOfMission . name ? `${ headOfMission . name . first } ${ headOfMission . name . last } ` : '' ;
126
127
127
128
const isMyMission = this . context . volunteer && ! ! mission . crew . find ( a => a . volunteer . id === this . context . volunteer . id ) ;
128
129
@@ -131,15 +132,17 @@ export default React.createClass({
131
132
{ this . state . message &&
132
133
< Alert type = { this . state . message . type } > { this . state . message . text } </ Alert >
133
134
}
135
+
134
136
{ this . props . isEditable
135
137
? < Button onClick = { this . toggleEdit } style = { right } > Edit</ Button >
136
138
: < Pill label = { mission . status } type = "info" style = { right } />
137
139
}
138
- < h2 > { mission . name } in { area } from { formatDate ( mission . start ) } till { formatDate ( mission . end ) } </ h2 >
139
140
140
- < h4 > Head of Mission: { headOfMission } </ h4 >
141
+ < h2 > { mission . name } { area && `in ${ area } ` } from { formatDate ( mission . start ) } till { formatDate ( mission . end ) } </ h2 >
141
142
142
- { this . renderCrew ( mission . crew ) }
143
+ { headOfMission &&
144
+ < h4 > Head of Mission: { headOfMission } </ h4 >
145
+ }
143
146
144
147
{ isMyMission &&
145
148
< div style = { { textAlign : 'right' , marginBottom : '1em' } } >
@@ -152,6 +155,8 @@ export default React.createClass({
152
155
</ div >
153
156
}
154
157
158
+ { this . renderCrew ( mission . crew ) }
159
+
155
160
{ position &&
156
161
< Map center = { position } zoom = { this . state . zoom } >
157
162
< TileLayer url = "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" />
0 commit comments