Skip to content

Commit ed190e4

Browse files
Merge pull request #6626 from topcoder-platform/tco23-leaderboards
Tco23 leaderboards
2 parents 3929c24 + 3b87d51 commit ed190e4

File tree

4 files changed

+13
-28
lines changed

4 files changed

+13
-28
lines changed

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ exports[`Matches shallow shapshot 1`] = `
55
className="src-shared-components-Leaderboard-Podium-themes-___default__Podium___1qIZm"
66
>
77
<div
8-
className="src-shared-components-Leaderboard-Podium-themes-___default__PodiumWrapCondense___3aV24"
8+
className="src-shared-components-Leaderboard-Podium-themes-___default__PodiumWrap___2hDWP"
99
style={
1010
Object {
1111
"justify-content": "space-between",
@@ -29,7 +29,6 @@ exports[`Matches shallow shapshot 1`] = `
2929
isCopilot={false}
3030
isTopGear={false}
3131
onUsernameClick={null}
32-
podiumPlaces={4}
3332
themeName="Default"
3433
/>
3534
</div>
@@ -50,7 +49,6 @@ exports[`Matches shallow shapshot 1`] = `
5049
isCopilot={false}
5150
isTopGear={false}
5251
onUsernameClick={null}
53-
podiumPlaces={4}
5452
themeName="Default"
5553
/>
5654
</div>
@@ -71,7 +69,6 @@ exports[`Matches shallow shapshot 1`] = `
7169
isCopilot={false}
7270
isTopGear={false}
7371
onUsernameClick={null}
74-
podiumPlaces={4}
7572
themeName="Default"
7673
/>
7774
</div>
@@ -92,7 +89,6 @@ exports[`Matches shallow shapshot 1`] = `
9289
isCopilot={false}
9390
isTopGear={false}
9491
onUsernameClick={null}
95-
podiumPlaces={4}
9692
themeName="Default"
9793
/>
9894
</div>

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,12 @@ export default function Podium(props) {
6464
isTopGear={isTopGear}
6565
isAlgo={isAlgo}
6666
themeName={themeName}
67-
podiumPlaces={comps.length}
6867
/>
6968
</div>
7069
));
7170

7271
return (
73-
<div styleName={`${stylesName}.${comps.length > 3 ? 'PodiumWrapCondense' : 'PodiumWrap'}`} style={comps.length === 4 ? { 'justify-content': 'space-between' } : {}}>
72+
<div styleName={`${stylesName}.${themeName === 'TCO23' ? 'PodiumWrapCondense' : 'PodiumWrap'}`} style={comps.length === 4 ? { 'justify-content': 'space-between' } : {}}>
7473
{podiumSpots}
7574
</div>
7675
);

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

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
*/
2626

2727
import React from 'react';
28-
import PT, { number } from 'prop-types';
28+
import PT from 'prop-types';
2929
import { Avatar } from 'topcoder-react-ui-kit';
3030
import { config } from 'topcoder-react-utils';
3131
import _ from 'lodash';
@@ -127,7 +127,6 @@ export default function PodiumSpot(props) {
127127
isTopGear,
128128
isAlgo,
129129
themeName,
130-
podiumPlaces,
131130
} = props;
132131

133132
const stylesName = THEME[themeName];
@@ -141,7 +140,7 @@ export default function PodiumSpot(props) {
141140
if (photoUrl) {
142141
photoUrl = `${config.CDN.PUBLIC}/avatar/${encodeURIComponent(photoUrl)}?size=160`;
143142
}
144-
let rootStyle = `${stylesName}.${podiumPlaces > 3 ? 'PodiumSpotCondense' : 'PodiumSpot'}`;
143+
let rootStyle = `${stylesName}.${themeName === 'TCO23' ? 'PodiumSpotCondense' : 'PodiumSpot'}`;
145144
if (PODIUM_ITEM_MODIFIER[competitor.rank]) rootStyle += ` ${stylesName}.PodiumSpot--${PODIUM_ITEM_MODIFIER[competitor.rank]}`;
146145
const fulfillment = competitor['tco_leaderboard.fulfillment']
147146
? (parseFloat(competitor['tco_leaderboard.fulfillment']) * 100).toFixed(2).replace(/[.,]00$/, '')
@@ -175,24 +174,15 @@ export default function PodiumSpot(props) {
175174
<div styleName={`${stylesName}.wave-wrap--${PODIUM_ITEM_MODIFIER[competitor.rank > 4 ? 4 : competitor.rank]}`}>
176175
<svg
177176
xmlns="http://www.w3.org/2000/svg"
178-
width={podiumPlaces > 3 ? 200 : 392}
179-
height={podiumPlaces > 3 ? 16 : 25}
177+
width={200}
178+
height={16}
180179
fill="none"
181-
viewBox={`0 0 ${podiumPlaces > 3 ? 200 : 392} ${podiumPlaces > 3 ? 16 : 25}`}
180+
viewBox="0 0 200 16"
182181
>
183-
{
184-
podiumPlaces > 3 ? (
185-
<path
186-
fill="#fff"
187-
d="M149.572 0.823649C173.331 0.823652 191.313 6.86156 198 9.88051L198 0.0893164L7.94832e-07 0.0892861L3.05705e-07 9.88048C6.08897 12.3283 17.0268 16 38.0337 16C64.2924 16 122.203 0.823644 149.572 0.823649Z"
188-
/>
189-
) : (
190-
<path
191-
fill="#fff"
192-
d="M296.123 1.385c47.038 0 82.638 9.395 95.877 14.093V.242H0v15.236C12.055 19.287 33.71 25 75.3 25c51.986 0 166.637-23.615 220.823-23.615z"
193-
/>
194-
)
195-
}
182+
<path
183+
fill="#fff"
184+
d="M149.572 0.823649C173.331 0.823652 191.313 6.86156 198 9.88051L198 0.0893164L7.94832e-07 0.0892861L3.05705e-07 9.88048C6.08897 12.3283 17.0268 16 38.0337 16C64.2924 16 122.203 0.823644 149.572 0.823649Z"
185+
/>
196186
</svg>
197187
<span styleName={`${stylesName}.leaderboard-avatar`}>
198188
{
@@ -376,7 +366,6 @@ PodiumSpot.propTypes = {
376366
isTopGear: PT.bool,
377367
isAlgo: PT.bool,
378368
themeName: PT.string,
379-
podiumPlaces: number,
380369
};
381370

382371
PodiumSpot.defaultProps = {
@@ -385,5 +374,4 @@ PodiumSpot.defaultProps = {
385374
isTopGear: false,
386375
isAlgo: false,
387376
themeName: 'Default',
388-
podiumPlaces: 1,
389377
};

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ $podium-border-color: #ededf2;
217217
text-transform: uppercase;
218218
margin-bottom: 8px;
219219
color: #000;
220+
border: none;
221+
padding: 0;
220222
}
221223

222224
.handle-link {

0 commit comments

Comments
 (0)