Skip to content

Commit 17f9a6e

Browse files
authored
Merge pull request #4721 from topcoder-platform/issue-4720
Fix tooltip in challenge listing page
2 parents fa16c88 + 3289dd4 commit 17f9a6e

File tree

3 files changed

+10
-16
lines changed

3 files changed

+10
-16
lines changed

__tests__/shared/components/challenge-listing/Tooltips/__snapshots__/TrackAbbreviationTooltip.jsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ exports[`Matches shallow shapshot 1`] = `
77
content={
88
<Tip
99
subTrack="CODE"
10-
track="DEVELOP"
10+
track="development"
1111
/>
1212
}
1313
defaultVisible={false}
@@ -37,7 +37,7 @@ exports[`Matches shallow shapshot 2`] = `
3737
content={
3838
<Tip
3939
subTrack="CODE"
40-
track="DEVELOP"
40+
track="development"
4141
/>
4242
}
4343
defaultVisible={false}

src/shared/components/challenge-listing/Tooltips/TrackAbbreviationTooltip/index.jsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,23 +88,17 @@ const HEADER = {
8888
WIREFRAMES: 'Wireframe (Wf)',
8989
};
9090

91-
const TRACK_COLOR_CLASS = {
92-
DESIGN: 'blue',
93-
DEVELOP: 'green',
94-
DATA_SCIENCE: 'orange',
95-
QA: 'purple',
96-
};
97-
9891
/**
9992
* Renders the tooltip's content.
10093
*/
10194
function Tip({
10295
subTrack,
10396
track,
10497
}) {
98+
const trackStyle = track.replace(' ', '-').toLowerCase();
10599
return (
106100
<div styleName="track-abbreviation-tooltip">
107-
<div styleName={`header ${TRACK_COLOR_CLASS[track]}`}>
101+
<div styleName={`header ${trackStyle}`}>
108102
{HEADER[subTrack]}
109103
</div>
110104
<div styleName="body">
@@ -116,7 +110,7 @@ function Tip({
116110

117111
Tip.defaultProps = {
118112
subTrack: 'CODE',
119-
track: 'DEVELOP',
113+
track: 'development',
120114
};
121115

122116
Tip.propTypes = {
@@ -152,7 +146,7 @@ function TrackAbbreviationTooltip({
152146

153147
TrackAbbreviationTooltip.defaultProps = {
154148
subTrack: 'CODE',
155-
track: 'DEVELOP',
149+
track: 'development',
156150
};
157151

158152
TrackAbbreviationTooltip.propTypes = {

src/shared/components/challenge-listing/Tooltips/TrackAbbreviationTooltip/style.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ $track-radius-4: $corner-radius * 2;
1414
font-weight: 700;
1515
padding-left: $base-unit * 2;
1616

17-
&.blue {
17+
&.design {
1818
border-left: $track-radius-4 solid $tc-light-blue;
1919
}
2020

21-
&.green {
21+
&.development {
2222
border-left: $track-radius-4 solid $tc-green;
2323
}
2424

25-
&.orange {
25+
&.data-science {
2626
border-left: $track-radius-4 solid $tc-orange;
2727
}
2828

29-
&.purple {
29+
&.quality-assurance {
3030
border-left: $track-radius-4 solid $tc-purple;
3131
}
3232
}

0 commit comments

Comments
 (0)