File tree Expand file tree Collapse file tree 2 files changed +19
-7
lines changed
src/components/ChallengesComponent Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Original file line number Diff line number Diff line change @@ -198,7 +198,10 @@ class ChallengeList extends Component {
198
198
</ Tabs > ) }
199
199
{
200
200
challenges . length === 0 && (
201
- < NoChallenge activeProject = { activeProject } />
201
+ < NoChallenge
202
+ activeProject = { activeProject }
203
+ selfService = { selfService }
204
+ />
202
205
)
203
206
}
204
207
{
Original file line number Diff line number Diff line change @@ -5,13 +5,21 @@ import React from 'react'
5
5
import PropTypes from 'prop-types'
6
6
import styles from './NoChallenge.module.scss'
7
7
8
- const NoChallenge = ( { activeProject } ) => {
8
+ const NoChallenge = ( {
9
+ activeProject,
10
+ selfService
11
+ } ) => {
12
+ let noChallengeMessage
13
+ if ( selfService || ! ! activeProject ) {
14
+ noChallengeMessage = selfService ? 'There are' : 'You have'
15
+ noChallengeMessage += ' no challenges at the moment'
16
+ } else {
17
+ noChallengeMessage = 'Please select a project to view challenges'
18
+ }
19
+
9
20
return (
10
21
< div className = { styles . noChallenge } >
11
- {
12
- activeProject
13
- ? ( < p > You have no challenges at the moment</ p > ) : ( < p > Please select a project to view challenges</ p > )
14
- }
22
+ < p > { noChallengeMessage } </ p >
15
23
</ div >
16
24
)
17
25
}
@@ -24,7 +32,8 @@ NoChallenge.propTypes = {
24
32
activeProject : PropTypes . shape ( {
25
33
id : PropTypes . number ,
26
34
name : PropTypes . string
27
- } )
35
+ } ) ,
36
+ selfService : PropTypes . bool
28
37
}
29
38
30
39
export default NoChallenge
You can’t perform that action at this time.
0 commit comments