From 38702da204d20340e5a55347a29aba71b53c61d5 Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 30 Sep 2024 13:21:31 +0100 Subject: [PATCH] add relative pp to the mini rankings and handle mobile support better for mini rankings --- src/app/global-error.tsx | 2 +- .../model/player/impl/scoresaber-player.ts | 12 ++++++---- src/components/loaders/database-loader.tsx | 4 ++-- src/components/player/player-data.tsx | 3 ++- src/components/ranking/mini.tsx | 23 +++++++++++++++---- src/hooks/use-is-mobile.ts | 13 +++++++---- 6 files changed, 39 insertions(+), 18 deletions(-) diff --git a/src/app/global-error.tsx b/src/app/global-error.tsx index bb2cb54..9388e06 100644 --- a/src/app/global-error.tsx +++ b/src/app/global-error.tsx @@ -24,4 +24,4 @@ export default function GlobalError({ ); -} \ No newline at end of file +} diff --git a/src/common/model/player/impl/scoresaber-player.ts b/src/common/model/player/impl/scoresaber-player.ts index d550570..4a268d6 100644 --- a/src/common/model/player/impl/scoresaber-player.ts +++ b/src/common/model/player/impl/scoresaber-player.ts @@ -1,9 +1,13 @@ -import Player, {StatisticChange} from "../player"; +import Player, { StatisticChange } from "../player"; import ScoreSaberPlayerToken from "@/common/model/token/scoresaber/score-saber-player-token"; -import {PlayerHistory} from "@/common/player/player-history"; -import {config} from "../../../../../config"; +import { PlayerHistory } from "@/common/player/player-history"; +import { config } from "../../../../../config"; import ky from "ky"; -import {formatDateMinimal, getDaysAgoDate, getMidnightAlignedDate,} from "@/common/time-utils"; +import { + formatDateMinimal, + getDaysAgoDate, + getMidnightAlignedDate, +} from "@/common/time-utils"; /** * A ScoreSaber player. diff --git a/src/components/loaders/database-loader.tsx b/src/components/loaders/database-loader.tsx index a82dcc2..5a65387 100644 --- a/src/components/loaders/database-loader.tsx +++ b/src/components/loaders/database-loader.tsx @@ -1,7 +1,7 @@ "use client"; -import {createContext, useEffect, useState} from "react"; -import Database, {db} from "../../common/database/database"; +import { createContext, useEffect, useState } from "react"; +import Database, { db } from "../../common/database/database"; import FullscreenLoader from "./fullscreen-loader"; /** diff --git a/src/components/player/player-data.tsx b/src/components/player/player-data.tsx index 9b44806..9a83b06 100644 --- a/src/components/player/player-data.tsx +++ b/src/components/player/player-data.tsx @@ -29,6 +29,7 @@ export default function PlayerData({ page, }: Props) { const isMobile = useIsMobile(); + console.log("mobile", isMobile); let player = initalPlayerData; const { data, isLoading, isError } = useQuery({ @@ -60,7 +61,7 @@ export default function PlayerData({ /> {!isMobile && ( -