mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-08 22:50:00 +08:00
feat(result page): open daily leaderboard when clicking the daily leaderboard rank (@theiereman) (#6133)
### Description Clicking on the rank (after getting a better rank in the daily leaderboard) will automatically open the leaderboard modal on the corresponding language screen  Honestly, I mostly added this for me because I like to go to the daily leaderboard after I did a good run and it was annoying me to have to open it + change the language to french + change to daily.
This commit is contained in:
parent
e6c800b128
commit
759829a6fb
3 changed files with 20 additions and 2 deletions
|
@ -269,7 +269,14 @@
|
|||
|
||||
<div class="group dailyLeaderboard hidden">
|
||||
<div class="top">daily leaderboard</div>
|
||||
<div class="bottom">-</div>
|
||||
<div
|
||||
id="dailyLeaderboardRank"
|
||||
aria-label="Show daily leaderboard"
|
||||
data-balloon-pos="up"
|
||||
class="bottom"
|
||||
>
|
||||
-
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="group source hidden">
|
||||
|
|
|
@ -831,7 +831,6 @@
|
|||
|
||||
&.dailyLeaderboard {
|
||||
max-width: 13rem;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ import {
|
|||
LeaderboardRank,
|
||||
} from "@monkeytype/contracts/schemas/leaderboards";
|
||||
import { Mode } from "@monkeytype/contracts/schemas/shared";
|
||||
import * as TestStats from "../test/test-stats";
|
||||
|
||||
const wrapperId = "leaderboardsWrapper";
|
||||
|
||||
|
@ -973,4 +974,15 @@ $("header nav").on("click", ".textButton", (e) => {
|
|||
}
|
||||
});
|
||||
|
||||
$(".pageTest").on("click", "#dailyLeaderboardRank", () => {
|
||||
currentTimeRange = "daily";
|
||||
updateYesterdayButton();
|
||||
languageSelector?.enable();
|
||||
|
||||
currentLanguage = TestStats.lastResult.language;
|
||||
languageSelector?.setSelected(currentLanguage);
|
||||
void update();
|
||||
show();
|
||||
});
|
||||
|
||||
Skeleton.save(wrapperId);
|
||||
|
|
Loading…
Add table
Reference in a new issue