cleanup and add weighted pp hover on score
Some checks failed
deploy / deploy (push) Failing after 1m34s

This commit is contained in:
Lee
2023-10-29 13:25:41 +00:00
parent 7b293b3eff
commit bef899d21e
10 changed files with 69 additions and 31 deletions

View File

@ -1,7 +1,6 @@
import { ScoresaberLeaderboardInfo } from "@/schemas/scoresaber/leaderboard";
import { ScoresaberScore } from "@/schemas/scoresaber/score";
import { formatNumber } from "@/utils/number";
import { scoresaberDifficultyNumberToName } from "@/utils/songUtils";
import { formatNumber } from "@/utils/numberUtils";
import { formatDate, formatTimeAgo } from "@/utils/timeUtils";
import Image from "next/image";
import Link from "next/link";
@ -18,9 +17,6 @@ export default function LeaderboardScore({
player,
leaderboard,
}: ScoreProps) {
const diffName = scoresaberDifficultyNumberToName(
leaderboard.difficulty.difficulty,
);
const accuracy = ((score.baseScore / leaderboard.maxScore) * 100).toFixed(2);
return (

View File

@ -1,5 +1,5 @@
import { ScoresaberPlayer } from "@/schemas/scoresaber/player";
import { formatNumber } from "@/utils/number";
import { formatNumber } from "@/utils/numberUtils";
import {
CategoryScale,
Chart as ChartJS,

View File

@ -1,7 +1,7 @@
import { ScoresaberPlayer } from "@/schemas/scoresaber/player";
import { useScoresaberScoresStore } from "@/store/scoresaberScoresStore";
import { useSettingsStore } from "@/store/settingsStore";
import { formatNumber } from "@/utils/number";
import { formatNumber } from "@/utils/numberUtils";
import {
calcPpBoundary,
getAveragePp,

View File

@ -1,7 +1,8 @@
import { ScoresaberLeaderboardInfo } from "@/schemas/scoresaber/leaderboard";
import { ScoresaberPlayer } from "@/schemas/scoresaber/player";
import { ScoresaberScore } from "@/schemas/scoresaber/score";
import { formatNumber } from "@/utils/number";
import { formatNumber } from "@/utils/numberUtils";
import { getPpGainedFromScore } from "@/utils/scoresaber/scores";
import {
scoresaberDifficultyNumberToName,
songDifficultyToColor,
@ -120,6 +121,10 @@ export default function Score({ score, player, leaderboard }: ScoreProps) {
<ScoreStatLabel
className="bg-blue-500 text-center"
value={formatNumber(score.pp.toFixed(2)) + "pp"}
title={`Weighted pp ${formatNumber(
getPpGainedFromScore(player.id, score),
2,
)}pp`}
/>
)}