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 {
198198 </ Tabs > ) }
199199 {
200200 challenges . length === 0 && (
201- < NoChallenge activeProject = { activeProject } />
201+ < NoChallenge
202+ activeProject = { activeProject }
203+ selfService = { selfService }
204+ />
202205 )
203206 }
204207 {
Original file line number Diff line number Diff line change @@ -5,13 +5,21 @@ import React from 'react'
55import PropTypes from 'prop-types'
66import styles from './NoChallenge.module.scss'
77
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+
920 return (
1021 < 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 >
1523 </ div >
1624 )
1725}
@@ -24,7 +32,8 @@ NoChallenge.propTypes = {
2432 activeProject : PropTypes . shape ( {
2533 id : PropTypes . number ,
2634 name : PropTypes . string
27- } )
35+ } ) ,
36+ selfService : PropTypes . bool
2837}
2938
3039export default NoChallenge
You can’t perform that action at this time.
0 commit comments