Skip to content

Commit 8ac5916

Browse files
Merge pull request #4907 from topcoder-platform/issue-2069
ChallengeTile: Fix MM link to Challenge details page
2 parents 77ea494 + 3fba920 commit 8ac5916

File tree

2 files changed

+11
-18
lines changed

2 files changed

+11
-18
lines changed

__tests__/shared/components/ChallengeTile/__snapshots__/index.jsx.snap

+7-4
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,15 @@ exports[`renders marathon 1`] = `
202202
className="src-shared-components-ChallengeTile-___style__completed-challenge___3w5tT"
203203
>
204204
<header>
205-
<a
205+
<Link
206206
className="src-shared-components-ChallengeTile-___style__name___1jF7j"
207-
href="https://community.topcoder.com/longcontest/stats/?module=ViewOverview&rd=17153"
207+
replace={false}
208+
to="/challenges/15404"
208209
>
209-
2018 TCO Marathon
210-
</a>
210+
<span>
211+
2018 TCO Marathon
212+
</span>
213+
</Link>
211214
<p
212215
className="src-shared-components-ChallengeTile-___style__subtrack-color___2AJaw"
213216
>

src/shared/components/ChallengeTile/index.jsx

+4-14
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* Challenge tile.
33
*/
44
/* eslint-env browser */
5-
import _ from 'lodash';
65
import React from 'react';
76
import PT from 'prop-types';
87
import { Link } from 'react-router-dom';
@@ -83,36 +82,27 @@ class ChallengeTile extends React.Component {
8382
margin: '10px 5px',
8483
};
8584

86-
const isDataScience = track === COMPETITION_TRACKS.DATA_SCIENCE;
8785
const isDevelopment = track === COMPETITION_TRACKS.DEVELOP;
8886
const isDesign = track === COMPETITION_TRACKS.DESIGN;
8987

90-
const roundId = isDataScience ? _.get(challenge, 'rounds.0.id') : 0;
91-
9288
return (
9389
<div styleName="challenge tile" style={extraStyle}>
9490
<div styleName={outStyleName}>
9591
<div styleName="completed-challenge">
9692
<header>
97-
{ !isDataScience && (!challenge.isPrivate
93+
{ !challenge.isPrivate
9894
? (
9995
<Link to={`/challenges/${challenge.id}`} styleName="name">
10096
<span>
10197
{ challenge.name }
10298
</span>
10399
</Link>
104-
) : (
100+
)
101+
: (
105102
<span>
106103
{ challenge.name }
107104
</span>
108-
)) }
109-
110-
{ isDataScience
111-
&& (
112-
<a styleName="name" href={`https://community.topcoder.com/longcontest/stats/?module=ViewOverview&rd=${roundId}`}>
113-
{ challenge.name }
114-
</a>
115-
) }
105+
)}
116106

117107
<p styleName="subtrack-color">
118108
{underscoreReplace(type)}

0 commit comments

Comments
 (0)