Skip to content

Commit 9cbbf73

Browse files
authored
Merge pull request #46 from topcoder-platform/develop
Challenge link fixes
2 parents d9dab4d + 140b417 commit 9cbbf73

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/server/renderer.jsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ export default (req, res) => {
3737
<title>Topcoder</title>
3838
<link rel="stylesheet" href="/style.css" />
3939
<meta charset="utf-8" />
40+
<meta
41+
content="width=device-width,initial-scale=1"
42+
name="viewport"
43+
/>
4044
</head>
4145
<body>
4246
<div id="react-view">${appHtml}</div>

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)