From 21cb7aaf8913d32c1b04a1cb8cf833dd08f38748 Mon Sep 17 00:00:00 2001 From: Liam Date: Sun, 22 Oct 2023 06:18:49 +0100 Subject: [PATCH] added header to show what you are viewing --- src/app/ranking/country/[country]/page.tsx | 50 ++++++++++++++-------- src/app/ranking/global/page.tsx | 41 ++++++++++-------- 2 files changed, 54 insertions(+), 37 deletions(-) diff --git a/src/app/ranking/country/[country]/page.tsx b/src/app/ranking/country/[country]/page.tsx index 48a7045..5f4bf88 100644 --- a/src/app/ranking/country/[country]/page.tsx +++ b/src/app/ranking/country/[country]/page.tsx @@ -10,6 +10,7 @@ import { ScoresaberPlayer } from "@/schemas/scoresaber/player"; import { fetchTopPlayers } from "@/utils/scoresaber/api"; import { useRouter, useSearchParams } from "next/navigation"; import { useCallback, useEffect, useState } from "react"; +import ReactCountryFlag from "react-country-flag"; type PageInfo = { loading: boolean; @@ -81,7 +82,7 @@ export default function RankingCountry({ if (!pageInfo.loading || error) return; updatePage(pageInfo.page); - }, [error, params.country, updatePage, pageInfo.page, pageInfo.loading]); + }, [error, country, updatePage, pageInfo.page, pageInfo.loading]); if (pageInfo.loading || error) { return ( @@ -113,25 +114,36 @@ export default function RankingCountry({ ) : ( - - - - - - - - - - - - - {players.map((player) => ( - - +
+
+ +

You are viewing scores from {country}

+
+ +
RankProfilePerformance PointsTotal PlaysTotal Ranked PlaysAvg Ranked Accuracy
+ + + + + + + + - ))} - -
RankProfilePerformance PointsTotal PlaysTotal Ranked PlaysAvg Ranked Accuracy
+ + + {players.map((player) => ( + + + + ))} + + + )} {/* Pagination */} diff --git a/src/app/ranking/global/page.tsx b/src/app/ranking/global/page.tsx index 56a11f0..c161729 100644 --- a/src/app/ranking/global/page.tsx +++ b/src/app/ranking/global/page.tsx @@ -107,25 +107,30 @@ export default function RankingGlobal() { ) : ( - - - - - - - - - - - - - {players.map((player) => ( - - +
+
+

You are viewing Global scores

+
+
RankProfilePerformance PointsTotal PlaysTotal Ranked PlaysAvg Ranked Accuracy
+ + + + + + + + - ))} - -
RankProfilePerformance PointsTotal PlaysTotal Ranked PlaysAvg Ranked Accuracy
+ + + {players.map((player) => ( + + + + ))} + + + )} {/* Pagination */}