Skip to content

Commit 49f49ea

Browse files
committed
review fixes
1 parent d04759e commit 49f49ea

File tree

6 files changed

+51
-10
lines changed

6 files changed

+51
-10
lines changed

__tests__/shared/components/Leaderboard/__snapshots__/LeaderboardTable.jsx.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ exports[`Matches shallow shapshot 1`] = `
7373
points
7474
</span>
7575
<span>
76-
challenges
76+
undefined challenges
7777
</span>
7878
</div>
7979
</td>
@@ -127,7 +127,7 @@ exports[`Matches shallow shapshot 1`] = `
127127
points
128128
</span>
129129
<span>
130-
challenges
130+
undefined challenges
131131
</span>
132132
</div>
133133
</td>
@@ -181,7 +181,7 @@ exports[`Matches shallow shapshot 1`] = `
181181
points
182182
</span>
183183
<span>
184-
challenges
184+
undefined challenges
185185
</span>
186186
</div>
187187
</td>
@@ -235,7 +235,7 @@ exports[`Matches shallow shapshot 1`] = `
235235
points
236236
</span>
237237
<span>
238-
challenges
238+
undefined challenges
239239
</span>
240240
</div>
241241
</td>

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

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ export default function LeaderboardTable(props) {
6363
themeName,
6464
} = props;
6565
const stylesName = THEME[themeName];
66+
/* eslint-disable no-confusing-arrow */
67+
/* eslint-disable no-nested-ternary */
68+
const addSufix = val => isAlgo ? (val !== 1 ? `${val} matches` : `${val} match`) : (val !== 1 ? `${val} challenges` : `${val} challenge`);
6669
const renderTableRows = comps => (
6770
comps.map((competitor) => {
6871
let photoUrl = competitor['member_profile_basic.photo_url'] || competitor.avatar;
@@ -92,7 +95,7 @@ export default function LeaderboardTable(props) {
9295
</td>
9396
<td styleName={`${stylesName}.col-handle`}>
9497
{
95-
onUsernameClick ? (
98+
onUsernameClick && themeName !== 'TCO23' ? (
9699
<div
97100
styleName={`${stylesName}.handle-link`}
98101
onClick={() => onUsernameClick(competitor)}
@@ -145,15 +148,32 @@ export default function LeaderboardTable(props) {
145148
<div styleName={`${stylesName}.winnings-info`}>
146149
{fulfillment && (<span>{fulfillment} fulfillment</span>)}
147150
<span>{competitor['tco_leaderboard.tco_points'] || competitor.points} points</span>
148-
<span>{competitor['tco_leaderboard.challenge_count'] || competitor.challengecount} challenges</span>
151+
<span>{addSufix(competitor['tco_leaderboard.challenge_count'] || competitor.challengecount)}</span>
149152
</div>
150153
</td>
151154
{
152155
isCopilot ? (
153156
<td styleName={`${stylesName}.col-fulfillment`}>{fulfillment}</td>
154157
) : null
155158
}
156-
<td styleName={`${stylesName}.col-challenges`}>{competitor['tco_leaderboard.challenge_count'] || competitor.challengecount}</td>
159+
<td styleName={`${stylesName}.col-challenges`}>
160+
{
161+
themeName === 'TCO23' ? (
162+
/* eslint-disable operator-linebreak */
163+
onUsernameClick ?
164+
(
165+
<div
166+
style={{ cursor: 'pointer', display: 'inline-block', color: '#0d61bf' }}
167+
onClick={() => onUsernameClick(competitor)}
168+
>
169+
{ `${addSufix(competitor['tco_leaderboard.challenge_count'] || competitor.challengecount)}` }
170+
</div>
171+
) : `${addSufix(competitor['tco_leaderboard.challenge_count'] || competitor.challengecount)}`
172+
) : (
173+
competitor['tco_leaderboard.challenge_count'] || competitor.challengecount
174+
)
175+
}
176+
</td>
157177
<td styleName={`${stylesName}.col-points`}>{formatPoints(competitor['tco_leaderboard.tco_points'] || competitor.points)}</td>
158178
{
159179
isTopGear ? (

src/shared/components/Leaderboard/LeaderboardTable/themes/tco23.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,10 @@ $table-cell-padding: 2px;
158158
border-radius: 50%;
159159
max-width: 100%;
160160
}
161+
162+
img {
163+
border: none;
164+
}
161165
}
162166

163167
.col-handle {
@@ -232,7 +236,6 @@ $table-cell-padding: 2px;
232236
}
233237

234238
.col-challenges {
235-
color: #0d61bf;
236239
font-weight: 500;
237240
}
238241
}

src/shared/components/Leaderboard/Podium/themes/tco23.scss

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
@include roboto-regular;
66

77
line-height: 1.42;
8-
margin: 100px auto 40px auto;
8+
margin: 88px auto 40px auto;
99
text-align: center;
1010

1111
@include sm {
@@ -34,7 +34,13 @@
3434

3535
.podium-column:nth-child(2) {
3636
@include md-to-xl {
37-
margin-top: -30px;
37+
margin-top: -16px;
38+
}
39+
}
40+
41+
.podium-column:nth-child(3) {
42+
@include md-to-xl {
43+
margin-top: 16px;
3844
}
3945
}
4046
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,19 @@ $podium-border-color: #ededf2;
142142
border-radius: 50%;
143143
height: 152px;
144144
width: 152px;
145+
background-color: #fff;
145146

146147
img {
147148
width: 100%;
148149
height: 100%;
149150
border-radius: 50%;
151+
margin: 0;
152+
}
153+
154+
svg {
155+
margin: 0;
156+
border-radius: 50%;
157+
background-color: #fff;
150158
}
151159
}
152160

src/shared/containers/tco/Leaderboard/themes/styles.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
.Leaderboard {
44
padding: 0;
55
margin: 40px auto;
6+
7+
@include sm {
8+
padding: 0 16px;
9+
}
610
}
711

812
.Leaderboard .section-title {

0 commit comments

Comments
 (0)