Skip to content

Commit 140b417

Browse files
committed
Fixes links to challenge details in the challenge listing
1 parent 25318ad commit 140b417

File tree

1 file changed

+6
-5
lines changed
  • src/shared/components/challenge-listing/ChallengeCard

1 file changed

+6
-5
lines changed

src/shared/components/challenge-listing/ChallengeCard/index.jsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
/* eslint jsx-a11y/no-static-element-interactions:0 */
55

66
import _ from 'lodash';
7+
import config from 'utils/config';
78
import moment from 'moment';
89
import React from 'react';
910
import PT from 'prop-types';
@@ -26,7 +27,7 @@ const numberWithCommas = n => (n ? n.toString().replace(/\B(?=(\d{3})+(?!\d))/g,
2627

2728
function ChallengeCard({
2829
challenge: passedInChallenge,
29-
config,
30+
config: configFromProps,
3031
sampleWinnerProfile,
3132
onTechTagClicked,
3233
}) {
@@ -40,8 +41,8 @@ function ChallengeCard({
4041
// challenge.totalPrize = challenge.prize.reduce((x, y) => y + x, 0)
4142

4243
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
4546
if (challenge.track === 'DATA_SCIENCE') {
4647
const id = `${challenge.id}`;
4748
if (id.length < ID_LENGTH) {
@@ -86,7 +87,7 @@ function ChallengeCard({
8687
</div>
8788
<div styleName="right-panel">
8889
<div styleName={isRegistrationOpen ? 'prizes with-register-button' : 'prizes'}>
89-
<PrizesTooltip challenge={challenge} config={config}>
90+
<PrizesTooltip challenge={challenge} config={configFromProps}>
9091
<div>
9192
<div><span styleName="dollar">$</span>{numberWithCommas(challenge.totalPrize)}</div>
9293
<div styleName="label">Purse</div>
@@ -96,7 +97,7 @@ function ChallengeCard({
9697

9798
<ChallengeStatus
9899
challenge={challenge}
99-
config={config}
100+
config={configFromProps}
100101
detailLink={challengeDetailLink(challenge)}
101102
sampleWinnerProfile={sampleWinnerProfile}
102103
/>

0 commit comments

Comments
 (0)