Skip to content

Commit 290b41b

Browse files
committed
colored handles init
1 parent 2a3ffcc commit 290b41b

File tree

3 files changed

+35
-23
lines changed

3 files changed

+35
-23
lines changed

src/shared/components/Leaderboard/LeaderboardTable/index.jsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import { Avatar } from 'topcoder-react-ui-kit';
2929
import { config } from 'topcoder-react-utils';
3030
import _ from 'lodash';
3131
import DefaultAvatar from 'assets/images/default-avatar-photo.svg';
32+
import { getRatingColor } from 'utils/tc';
3233

3334

3435
import avatarStyles from '../avatarStyles.scss';
@@ -68,6 +69,7 @@ export default function LeaderboardTable(props) {
6869
const fulfillment = competitor['tco_leaderboard.fulfillment']
6970
? (parseFloat(competitor['tco_leaderboard.fulfillment']) * 100).toFixed(2).replace(/[.,]00$/, '')
7071
: competitor.fulfillment;
72+
const rating = competitor['member_profile_basic.max_rating'];
7173
return (
7274
<tr key={competitor.rank}>
7375
<td styleName={`${stylesName}.col-rank`}>{competitor.rank}</td>
@@ -91,11 +93,16 @@ export default function LeaderboardTable(props) {
9193
<div
9294
styleName={`${stylesName}.handle-link`}
9395
onClick={() => onUsernameClick(competitor)}
96+
style={{ color: rating ? getRatingColor(rating) : null }}
9497
>
9598
{competitor['member_profile_basic.handle'] || competitor.handle}
9699
</div>
97100
) : (
98-
<a href={`${window.origin}/members/${competitor['member_profile_basic.handle'] || competitor.handle}/`} target={`${_.includes(window.origin, 'www') ? '_self' : '_blank'}`}>
101+
<a
102+
href={`${window.origin}/members/${competitor['member_profile_basic.handle'] || competitor.handle}/`}
103+
target={`${_.includes(window.origin, 'www') ? '_self' : '_blank'}`}
104+
style={{ color: rating ? getRatingColor(rating) : null }}
105+
>
99106
{competitor['member_profile_basic.handle'] || competitor.handle}
100107
</a>
101108
)

src/shared/components/Leaderboard/PodiumSpot/index.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import { Avatar } from 'topcoder-react-ui-kit';
3030
import { config } from 'topcoder-react-utils';
3131
import _ from 'lodash';
3232
import DefaultAvatar from 'assets/images/default-avatar-photo.svg';
33+
import { getRatingColor } from 'utils/tc';
3334

3435
import avatarStyles from '../avatarStyles.scss';
3536
import defaultStyles from './themes/styles.scss'; // eslint-disable-line
@@ -110,7 +111,7 @@ export default function PodiumSpot(props) {
110111
const fulfillment = competitor['tco_leaderboard.fulfillment']
111112
? (parseFloat(competitor['tco_leaderboard.fulfillment']) * 100).toFixed(2).replace(/[.,]00$/, '')
112113
: competitor.fulfillment;
113-
114+
const rating = competitor['member_profile_basic.max_rating'];
114115
return (
115116
<div styleName={rootStyle}>
116117
<span styleName={`${stylesName}.leaderboard-avatar`}>
@@ -159,6 +160,7 @@ export default function PodiumSpot(props) {
159160
<div
160161
styleName={`${stylesName}.handle-link`}
161162
onClick={() => onUsernameClick(competitor)}
163+
style={{ color: rating ? getRatingColor(rating) : null }}
162164
>
163165
{competitor['member_profile_basic.handle'] || competitor.handle}
164166
</div>
@@ -167,6 +169,7 @@ export default function PodiumSpot(props) {
167169
styleName={`${stylesName}.profile-link`}
168170
href={`${window.origin}/members/${competitor['member_profile_basic.handle'] || competitor.handle}/`}
169171
target={`${_.includes(window.origin, 'www') ? '_self' : '_blank'}`}
172+
style={{ color: rating ? getRatingColor(rating) : null }}
170173
>
171174
{competitor['member_profile_basic.handle'] || competitor.handle}
172175
</a>

src/shared/components/Leaderboard/PodiumSpot/themes/tco20.scss

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ $podium-border-color: #ededf2;
33

44
.PodiumSpot {
55
border-radius: 6px;
6-
padding: 23px 15px;
6+
padding: 23px 25px;
77
display: flex;
88
width: auto;
99

@@ -19,12 +19,14 @@ $podium-border-color: #ededf2;
1919
@include roboto-black;
2020

2121
border-radius: 20px;
22-
padding: 3px 9px;
22+
padding: 4px 9px 3px;
2323
display: inline-block;
2424
position: absolute;
2525
right: 0;
2626
bottom: -10px;
2727
font-size: 15px;
28+
width: 30px;
29+
height: 30px;
2830
}
2931

3032
.winnings-info span {
@@ -91,13 +93,13 @@ $podium-border-color: #ededf2;
9193
.handle-link,
9294
a.profile-link {
9395
color: #0d61bf;
94-
font-family: Barlow, sans-serif;
95-
font-size: 16px;
96-
font-weight: 600;
97-
line-height: 19px;
96+
font-family: Roboto, sans-serif;
97+
font-size: 20px;
98+
font-weight: 500;
99+
line-height: 24px;
98100
text-align: left;
99101
text-decoration: underline;
100-
margin-bottom: 13px;
102+
margin-bottom: 14px;
101103

102104
&:hover {
103105
text-decoration: none;
@@ -110,38 +112,38 @@ $podium-border-color: #ededf2;
110112
}
111113

112114
.PodiumSpot--first {
113-
background-color: #ffd84d;
115+
background-color: #f4f4f4;
114116

115117
.ranking {
116-
background-color: #2a2a2a;
117-
color: #fff;
118+
background-color: #ffd84c;
119+
color: #2a2a2a;
118120
}
119121
}
120122

121123
.PodiumSpot--second {
122-
background-color: #d4d4d4;
124+
background-color: #f4f4f4;
123125

124126
.ranking {
125-
background-color: #2a2a2a;
126-
color: #fff;
127+
background-color: #716d66;
128+
color: #2a2a2a;
127129
}
128130
}
129131

130132
.PodiumSpot--third {
131-
background-color: #f1a87d;
133+
background-color: #f4f4f4;
132134

133135
.ranking {
134-
background-color: #2a2a2a;
135-
color: #fff;
136+
background-color: #844d29;
137+
color: #2a2a2a;
136138
}
137139
}
138140

139141
.PodiumSpot--fourth {
140-
background-color: #8dccd4;
142+
background-color: #f4f4f4;
141143

142144
.ranking {
143-
background-color: #2a2a2a;
144-
color: #fff;
145+
background-color: #844d29;
146+
color: #2a2a2a;
145147
}
146148
}
147149

@@ -152,7 +154,7 @@ $podium-border-color: #ededf2;
152154
margin-top: 0;
153155

154156
.leaderboard-avatar {
155-
height: 79px;
156-
width: 79px;
157+
height: 110px;
158+
width: 110px;
157159
}
158160
}

0 commit comments

Comments
 (0)