File tree 3 files changed +12
-2
lines changed
containers/challenge-detail
3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ function getSelectorStyle(selectedView, currentView) {
19
19
20
20
export default function ChallengeViewSelector ( props ) {
21
21
const {
22
+ isLoggedIn,
22
23
challenge,
23
24
checkpointCount,
24
25
numOfRegistrants,
@@ -123,7 +124,7 @@ export default function ChallengeViewSelector(props) {
123
124
)
124
125
}
125
126
{
126
- numOfSubmissions ? (
127
+ ( numOfSubmissions && isLoggedIn ) ? (
127
128
< a
128
129
tabIndex = "0"
129
130
role = "tab"
@@ -186,6 +187,7 @@ export default function ChallengeViewSelector(props) {
186
187
}
187
188
188
189
ChallengeViewSelector . defaultProps = {
190
+ isLoggedIn : false ,
189
191
challenge : { } ,
190
192
checkpointCount : 0 ,
191
193
numOfRegistrants : 0 ,
@@ -194,6 +196,7 @@ ChallengeViewSelector.defaultProps = {
194
196
} ;
195
197
196
198
ChallengeViewSelector . propTypes = {
199
+ isLoggedIn : PT . bool ,
197
200
challenge : PT . shape ( {
198
201
subTrack : PT . any ,
199
202
details : PT . shape ( {
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ const DAY_MS = 24 * HOUR_MS;
34
34
35
35
export default function ChallengeHeader ( props ) {
36
36
const {
37
+ isLoggedIn,
37
38
challenge,
38
39
challengesUrl,
39
40
challengeTypes,
@@ -447,6 +448,7 @@ export default function ChallengeHeader(props) {
447
448
}
448
449
</ div >
449
450
< TabSelector
451
+ isLoggedIn = { isLoggedIn }
450
452
challenge = { challenge }
451
453
onSelectorClicked = { onSelectorClicked }
452
454
trackLower = { trackLower }
@@ -465,6 +467,7 @@ export default function ChallengeHeader(props) {
465
467
}
466
468
467
469
ChallengeHeader . defaultProps = {
470
+ isLoggedIn : false ,
468
471
checkpoints : { } ,
469
472
isMenuOpened : false ,
470
473
hasThriveArticles : false ,
@@ -473,6 +476,7 @@ ChallengeHeader.defaultProps = {
473
476
} ;
474
477
475
478
ChallengeHeader . propTypes = {
479
+ isLoggedIn : PT . bool ,
476
480
checkpoints : PT . shape ( ) ,
477
481
challenge : PT . shape ( {
478
482
id : PT . string . isRequired ,
Original file line number Diff line number Diff line change @@ -365,6 +365,8 @@ class ChallengeDetailPageContainer extends React.Component {
365
365
366
366
const submissionsViewable = _ . find ( metadata , { type : 'submissionsViewable' } ) ;
367
367
368
+ const isLoggedIn = ! _ . isEmpty ( auth . tokenV3 ) ;
369
+
368
370
/* Generation of data for SEO meta-tags. */
369
371
let prizesStr ;
370
372
if ( challenge . prizes && challenge . prizes . length ) {
@@ -445,6 +447,7 @@ class ChallengeDetailPageContainer extends React.Component {
445
447
! isEmpty
446
448
&& (
447
449
< ChallengeHeader
450
+ isLoggedIn = { isLoggedIn }
448
451
challenge = { challenge }
449
452
challengeId = { challengeId }
450
453
challengeTypes = { challengeTypes }
@@ -523,7 +526,7 @@ class ChallengeDetailPageContainer extends React.Component {
523
526
)
524
527
}
525
528
{
526
- ! isEmpty && selectedTab === DETAIL_TABS . SUBMISSIONS
529
+ ! isEmpty && isLoggedIn && selectedTab === DETAIL_TABS . SUBMISSIONS
527
530
&& (
528
531
< Submissions
529
532
challenge = { challenge }
You can’t perform that action at this time.
0 commit comments