Skip to content

Commit a0dda75

Browse files
committed
history modal fixes
1 parent bfb9e82 commit a0dda75

File tree

3 files changed

+35
-17
lines changed

3 files changed

+35
-17
lines changed

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

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,23 @@ class ChallengeHistoryModal extends Component {
4242
const placeLabel = competitor['member_profile_basic.handle'] ? 'tco_leaderboard.placement' : 'place';
4343
const pointsLabel = competitor['member_profile_basic.handle'] ? 'tco_leaderboard.tco_points' : 'points';
4444
const styles = THEMES[themeName] || THEMES.Default;
45+
/* eslint-disable no-confusing-arrow */
46+
const sortInner = () => themeName === 'TCO23' ? (
47+
<svg width="14" height="12" viewBox="0 0 14 12" fill="none" xmlns="http://www.w3.org/2000/svg">
48+
<path fillRule="evenodd" clipRule="evenodd" d="M3.26721 0.267169C3.48786 0.046523 3.84559 0.046523 4.06624 0.267169L6.73291 2.93384C6.95355 3.15448 6.95355 3.51222 6.73291 3.73287C6.51226 3.95351 6.15452 3.95351 5.93388 3.73287L4.23173 2.03072V8.66668C4.23173 8.97873 3.97877 9.23168 3.66673 9.23168C3.35468 9.23168 3.10173 8.97873 3.10173 8.66668V2.03072L1.39957 3.73287C1.17893 3.95351 0.821189 3.95351 0.600543 3.73287C0.379897 3.51222 0.379897 3.15448 0.600543 2.93384L3.26721 0.267169ZM9.76839 3.33335C9.76839 3.02131 10.0214 2.76835 10.3334 2.76835C10.6454 2.76835 10.8984 3.02131 10.8984 3.33335V9.96932L12.6005 8.26717C12.8212 8.04652 13.1789 8.04652 13.3996 8.26717C13.6202 8.48781 13.6202 8.84555 13.3996 9.0662L10.7329 11.7329C10.5123 11.9535 10.1545 11.9535 9.93388 11.7329L7.26721 9.0662C7.04656 8.84555 7.04656 8.48781 7.26721 8.26717C7.48786 8.04652 7.84559 8.04652 8.06624 8.26717L9.76839 9.96932V3.33335Z" fill="#767676" />
49+
</svg>
50+
) : (
51+
<div>
52+
<div className={cn(styles['sort-up'], {
53+
active: sortParam.field === pointsLabel && sortParam.order === styles.asc,
54+
})}
55+
/>
56+
<div className={cn(styles['sort-down'], {
57+
active: sortParam.field === pointsLabel && sortParam.order === styles.desc,
58+
})}
59+
/>
60+
</div>
61+
);
4562

4663
return (
4764
<Modal onCancel={onCancel} theme={THEMES[themeName] || THEMES.Default}>
@@ -78,14 +95,7 @@ class ChallengeHistoryModal extends Component {
7895
}}
7996
type="button"
8097
>
81-
<div className={cn(styles['sort-up'], {
82-
active: sortParam.field === placeLabel && sortParam.order === styles.asc,
83-
})}
84-
/>
85-
<div className={cn(styles['sort-down'], {
86-
active: sortParam.field === placeLabel && sortParam.order === styles.desc,
87-
})}
88-
/>
98+
{ sortInner() }
8999
</button>
90100
</div>
91101
</th>
@@ -107,14 +117,7 @@ class ChallengeHistoryModal extends Component {
107117
}}
108118
type="button"
109119
>
110-
<div className={cn(styles['sort-up'], {
111-
active: sortParam.field === pointsLabel && sortParam.order === styles.asc,
112-
})}
113-
/>
114-
<div className={cn(styles['sort-down'], {
115-
active: sortParam.field === pointsLabel && sortParam.order === styles.desc,
116-
})}
117-
/>
120+
{ sortInner() }
118121
</button>
119122
</div>
120123
</th>

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,13 @@ export default function LeaderboardTable(props) {
148148
<div styleName={`${stylesName}.winnings-info`}>
149149
{fulfillment && (<span>{fulfillment} fulfillment</span>)}
150150
<span>{competitor['tco_leaderboard.tco_points'] || competitor.points} points</span>
151-
<span>{addSufix(competitor['tco_leaderboard.challenge_count'] || competitor.challengecount)}</span>
151+
{
152+
themeName === 'TCO23' ? (
153+
<div onClick={() => onUsernameClick(competitor)} styleName={`${stylesName}.mobile-link`}>
154+
{addSufix(competitor['tco_leaderboard.challenge_count'] || competitor.challengecount)}
155+
</div>
156+
) : <span>{addSufix(competitor['tco_leaderboard.challenge_count'] || competitor.challengecount)}</span>
157+
}
152158
</div>
153159
</td>
154160
{

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,15 @@ $table-cell-padding: 2px;
213213
span {
214214
display: block;
215215
}
216+
217+
.mobile-link {
218+
color: #0d61bf;
219+
font-weight: 500;
220+
font-size: 14px;
221+
line-height: 20px;
222+
text-decoration: underline;
223+
cursor: pointer;
224+
}
216225
}
217226

218227
.col-fulfillment {

0 commit comments

Comments
 (0)