File tree 2 files changed +9
-7
lines changed
__tests__/shared/components/ChallengeTile/__snapshots__
src/shared/components/ChallengeTile
2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -241,9 +241,6 @@ exports[`renders marathon 1`] = `
241
241
</p >
242
242
</div >
243
243
</div >
244
- <p
245
- className = " src-shared-components-ChallengeTile-___style__roles___1V-WA"
246
- />
247
244
</div >
248
245
</div >
249
246
</div >
Original file line number Diff line number Diff line change 2
2
* Challenge tile.
3
3
*/
4
4
/* eslint-env browser */
5
+ import _ from 'lodash' ;
5
6
import React from 'react' ;
6
7
import PT from 'prop-types' ;
7
8
import { Link } from 'react-router-dom' ;
@@ -74,6 +75,7 @@ class ChallengeTile extends React.Component {
74
75
} = this . props ;
75
76
76
77
const { track, type } = challenge ;
78
+ const roles = _ . get ( challenge , 'userDetails.roles' ) ;
77
79
78
80
const outStyleName = `challenge tile-view ${ track . replace ( ' ' , '-' ) . toLowerCase ( ) } ` ;
79
81
const extraStyle = {
@@ -307,19 +309,22 @@ class ChallengeTile extends React.Component {
307
309
) }
308
310
</ div >
309
311
310
- < p styleName = "roles" >
311
- { track !== COMPETITION_TRACKS . DS
312
+ { ! _ . isEmpty ( roles )
313
+ && (
314
+ < p styleName = "roles" >
315
+ { track !== COMPETITION_TRACKS . DS
312
316
&& (
313
317
< span >
314
318
< span >
315
319
Role:
316
320
</ span >
317
321
< span >
318
- { listRoles ( challenge . userDetails . roles ) }
322
+ { listRoles ( roles ) }
319
323
</ span >
320
324
</ span >
321
325
) }
322
- </ p >
326
+ </ p >
327
+ ) }
323
328
</ div >
324
329
</ div >
325
330
</ div >
You can’t perform that action at this time.
0 commit comments