Skip to content

Commit 04bba95

Browse files
committed
topcoder-platform#172 Remove Current Phase from specific tabs
topcoder-platform#172 Remove Current Phase from specific tabs
1 parent 4f268c0 commit 04bba95

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

src/components/ChallengesComponent/ChallengeCard/index.js

+9-4
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ class ChallengeCard extends React.Component {
156156

157157
render () {
158158
const { isLaunch, isConfirm, isSaving } = this.state
159-
const { challenge } = this.props
159+
const { challenge, shouldShowCurrentPhase } = this.props
160160
const { phaseMessage, endTime } = getPhaseInfo(challenge)
161161
const communityAppUrl = `${COMMUNITY_APP_URL}/challenges/${challenge.legacyId}`
162162
return (
@@ -203,10 +203,10 @@ class ChallengeCard extends React.Component {
203203
<a className={styles.col2} href={communityAppUrl}>
204204
{renderStatus(challenge.status.toUpperCase())}
205205
</a>
206-
<a className={styles.col3} href={communityAppUrl}>
206+
{shouldShowCurrentPhase && (<a className={styles.col3} href={communityAppUrl}>
207207
<span className={styles.block}>{phaseMessage}</span>
208208
<span className='block light-text'>{endTime}</span>
209-
</a>
209+
</a>)}
210210
<div className={cn(styles.col4, styles.editingContainer)}>
211211
{hoverComponents(challenge, this.onUpdateLaunch)}
212212
</div>
@@ -225,8 +225,13 @@ class ChallengeCard extends React.Component {
225225
}
226226
}
227227

228+
ChallengeCard.defaultPrps = {
229+
shouldShowCurrentPhase: true
230+
}
231+
228232
ChallengeCard.propTypes = {
229-
challenge: PropTypes.object
233+
challenge: PropTypes.object,
234+
shouldShowCurrentPhase: PropTypes.bool
230235
}
231236

232237
export default withRouter(ChallengeCard)

src/components/ChallengesComponent/ChallengeList/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class ChallengeList extends Component {
131131
<div className={styles.header}>
132132
<div className={styles.col1}>Challenges Name</div>
133133
<div className={styles.col2}>Status</div>
134-
<div className={styles.col3}>Current phase</div>
134+
{(selectedTab === 0) && (<div className={styles.col3}>Current phase</div>)}
135135
<div className={styles.col4}>&nbsp;</div>
136136
</div>
137137
)
@@ -141,7 +141,7 @@ class ChallengeList extends Component {
141141
<ul className={styles.challengeList}>
142142
{
143143
map(challenges, (c) => {
144-
return <li className={styles.challengeItem} key={`challenge-card-${c.id}`}><ChallengeCard challenge={c} /></li>
144+
return <li className={styles.challengeItem} key={`challenge-card-${c.id}`}><ChallengeCard shouldShowCurrentPhase={selectedTab === 0} challenge={c} /></li>
145145
})
146146
}
147147
</ul>

0 commit comments

Comments
 (0)