4
4
/* eslint jsx-a11y/no-static-element-interactions:0 */
5
5
6
6
import _ from 'lodash' ;
7
+ import config from 'utils/config' ;
7
8
import moment from 'moment' ;
8
9
import React from 'react' ;
9
10
import PT from 'prop-types' ;
@@ -26,7 +27,7 @@ const numberWithCommas = n => (n ? n.toString().replace(/\B(?=(\d{3})+(?!\d))/g,
26
27
27
28
function ChallengeCard ( {
28
29
challenge : passedInChallenge ,
29
- config,
30
+ config : configFromProps ,
30
31
sampleWinnerProfile,
31
32
onTechTagClicked,
32
33
} ) {
@@ -40,8 +41,8 @@ function ChallengeCard({
40
41
// challenge.totalPrize = challenge.prize.reduce((x, y) => y + x, 0)
41
42
42
43
const challengeDetailLink = ( ) => {
43
- const challengeUrl = `${ config . MAIN_URL } /challenge-details/` ;
44
- const mmDetailUrl = `${ window . location . protocol } ${ config . COMMUNITY_URL } /tc?module=MatchDetails&rd=` ; // Marathon Match details
44
+ const challengeUrl = `${ config . URL . BASE } /challenge-details/` ;
45
+ const mmDetailUrl = `${ config . URL . COMMUNITY } /tc?module=MatchDetails&rd=` ; // Marathon Match details
45
46
if ( challenge . track === 'DATA_SCIENCE' ) {
46
47
const id = `${ challenge . id } ` ;
47
48
if ( id . length < ID_LENGTH ) {
@@ -86,7 +87,7 @@ function ChallengeCard({
86
87
</ div >
87
88
< div styleName = "right-panel" >
88
89
< div styleName = { isRegistrationOpen ? 'prizes with-register-button' : 'prizes' } >
89
- < PrizesTooltip challenge = { challenge } config = { config } >
90
+ < PrizesTooltip challenge = { challenge } config = { configFromProps } >
90
91
< div >
91
92
< div > < span styleName = "dollar" > $</ span > { numberWithCommas ( challenge . totalPrize ) } </ div >
92
93
< div styleName = "label" > Purse</ div >
@@ -96,7 +97,7 @@ function ChallengeCard({
96
97
97
98
< ChallengeStatus
98
99
challenge = { challenge }
99
- config = { config }
100
+ config = { configFromProps }
100
101
detailLink = { challengeDetailLink ( challenge ) }
101
102
sampleWinnerProfile = { sampleWinnerProfile }
102
103
/>
0 commit comments