File tree 3 files changed +36
-30
lines changed
src/shared/components/challenge-detail
3 files changed +36
-30
lines changed Original file line number Diff line number Diff line change @@ -178,7 +178,21 @@ export default function ChallengeViewSelector(props) {
178
178
}
179
179
{ ( ( ) => {
180
180
if ( hasRegistered || Boolean ( roles . length ) ) {
181
- if ( _ . isEmpty ( discuss ) ) {
181
+ if ( ! _ . isEmpty ( discuss ) ) {
182
+ return (
183
+ discuss . map ( d => (
184
+ < a
185
+ href = { d . url }
186
+ styleName = { getSelectorStyle ( selectedView , DETAIL_TABS . CHALLENGE_FORUM ) }
187
+ target = "_blank"
188
+ rel = "oopener noreferrer"
189
+ >
190
+ CHALLENGE DISCUSSION
191
+ </ a >
192
+ ) )
193
+ ) ;
194
+ }
195
+ if ( forumId > 0 ) {
182
196
return (
183
197
< a
184
198
href = { `${ config . URL . FORUMS } ${ forumEndpoint } ` }
@@ -190,18 +204,6 @@ export default function ChallengeViewSelector(props) {
190
204
</ a >
191
205
) ;
192
206
}
193
- return (
194
- discuss . map ( d => (
195
- < a
196
- href = { d . url }
197
- styleName = { getSelectorStyle ( selectedView , DETAIL_TABS . CHALLENGE_FORUM ) }
198
- target = "_blank"
199
- rel = "oopener noreferrer"
200
- >
201
- CHALLENGE DISCUSSION
202
- </ a >
203
- ) )
204
- ) ;
205
207
}
206
208
return '' ;
207
209
} ) ( ) }
Original file line number Diff line number Diff line change @@ -322,19 +322,21 @@ export default function SideBar({
322
322
pass screening.
323
323
</ a >
324
324
</ p >
325
- < p styleName = "link-like-paragraph" >
326
- Questions?
327
- ‌
328
- { _ . isEmpty ( discuss ) && (
329
- < a
330
- href = { forumLink }
331
- target = "_blank"
332
- rel = "oopener noreferrer"
333
- >
334
- Ask in the Challenge Discussion Forums.
335
- </ a >
336
- ) }
337
- </ p >
325
+ { ( forumLink || ! _ . isEmpty ( discuss ) ) && (
326
+ < p styleName = "link-like-paragraph" >
327
+ Questions?
328
+ ‌
329
+ { _ . isEmpty ( discuss ) && (
330
+ < a
331
+ href = { forumLink }
332
+ target = "_blank"
333
+ rel = "oopener noreferrer"
334
+ >
335
+ Ask in the Challenge Discussion Forums.
336
+ </ a >
337
+ ) }
338
+ </ p >
339
+ ) }
338
340
{ ! _ . isEmpty ( discuss ) && (
339
341
< ul >
340
342
{ discuss . map ( d => (
Original file line number Diff line number Diff line change @@ -80,10 +80,12 @@ export default function ChallengeDetailsView(props) {
80
80
d . type === 'challenge' && ! _ . isEmpty ( d . url )
81
81
) ) ;
82
82
83
- let forumLink = track . toLowerCase ( ) === 'design'
84
- ? `/?module=ThreadList&forumID=${ forumId } `
85
- : `/?module=Category&categoryID=${ forumId } ` ;
86
- forumLink = `${ config . URL . FORUMS } ${ forumLink } ` ;
83
+ let forumLink = '' ;
84
+ if ( forumId > 0 ) {
85
+ forumLink = track . toLowerCase ( ) === 'design'
86
+ ? `/?module=ThreadList&forumID=${ forumId } `
87
+ : `/?module=Category&categoryID=${ forumId } ` ;
88
+ }
87
89
88
90
let isWipro = false ;
89
91
const wiproCommunity = communitiesList . find ( x => x . communityId === 'wipro' ) ;
You can’t perform that action at this time.
0 commit comments