diff --git a/projects/common/src/utils/beatsaver.util.ts b/projects/common/src/utils/beatsaver.util.ts new file mode 100644 index 0000000..af4833c --- /dev/null +++ b/projects/common/src/utils/beatsaver.util.ts @@ -0,0 +1,11 @@ +import { BeatSaverMap } from "../model/beatsaver/beatsaver-map"; + +/** + * Gets the beatSaver mapper profile url. + * + * @param map the beatsaver map + * @returns the beatsaver mapper profile url + */ +export function getBeatSaverMapperProfileUrl(map?: BeatSaverMap) { + return map != undefined ? `https://beatsaver.com/profile/${map?.author.id}` : undefined; +} diff --git a/projects/common/src/scoresaber.util.ts b/projects/common/src/utils/scoresaber.util.ts similarity index 87% rename from projects/common/src/scoresaber.util.ts rename to projects/common/src/utils/scoresaber.util.ts index e729239..c45c55a 100644 --- a/projects/common/src/scoresaber.util.ts +++ b/projects/common/src/utils/scoresaber.util.ts @@ -1,6 +1,6 @@ -import ScoreSaberPlayerToken from "./types/token/scoresaber/score-saber-player-token"; -import ScoreSaberLeaderboardPlayerInfoToken from "./types/token/scoresaber/score-saber-leaderboard-player-info-token"; -import ScoreSaberPlayer from "./player/impl/scoresaber-player"; +import ScoreSaberPlayerToken from "../types/token/scoresaber/score-saber-player-token"; +import ScoreSaberLeaderboardPlayerInfoToken from "../types/token/scoresaber/score-saber-leaderboard-player-info-token"; +import ScoreSaberPlayer from "../player/impl/scoresaber-player"; type ScoreSaberRole = { /** diff --git a/projects/website/src/components/leaderboard/leaderboard-info.tsx b/projects/website/src/components/leaderboard/leaderboard-info.tsx index 47291b3..fe32e24 100644 --- a/projects/website/src/components/leaderboard/leaderboard-info.tsx +++ b/projects/website/src/components/leaderboard/leaderboard-info.tsx @@ -4,6 +4,8 @@ import { LeaderboardSongStarCount } from "@/components/leaderboard/leaderboard-s import ScoreButtons from "@/components/score/score-buttons"; import ScoreSaberLeaderboard from "@ssr/common/leaderboard/impl/scoresaber-leaderboard"; import { BeatSaverMap } from "@ssr/common/model/beatsaver/beatsaver-map"; +import { getBeatSaverMapperProfileUrl } from "@ssr/common/utils/beatsaver.util"; +import FallbackLink from "@/components/fallback-link"; type LeaderboardInfoProps = { /** @@ -35,7 +37,12 @@ export function LeaderboardInfo({ leaderboard, beatSaverMap }: LeaderboardInfoPr {/* Song Stats */}
- Mapper: {leaderboard.levelAuthorName}
+ Mapper:{" "}
+
Plays: {leaderboard.plays} ({leaderboard.dailyPlays} today) diff --git a/projects/website/src/components/leaderboard/leaderboard-scores.tsx b/projects/website/src/components/leaderboard/leaderboard-scores.tsx index 20e5d35..bb33008 100644 --- a/projects/website/src/components/leaderboard/leaderboard-scores.tsx +++ b/projects/website/src/components/leaderboard/leaderboard-scores.tsx @@ -139,9 +139,9 @@ export default function LeaderboardScores({ {currentScores.scores.length === 0 &&
No scores found. Invalid Page?
}Accuracy | Misses | PP | -Modifiers | +Mods |
---|