add beatleader score fetching and add icons to FC
Some checks failed
deploy / deploy (push) Failing after 2s

This commit is contained in:
Lee
2023-10-22 13:47:56 +01:00
parent 2e93a1b27f
commit 80e6c0da43
33 changed files with 979 additions and 124 deletions

View File

@ -1,3 +1,4 @@
import { AppProvider } from "@/components/AppProvider";
import { ssrSettings } from "@/ssrSettings";
import { Metadata } from "next";
import { Inter } from "next/font/google";
@ -40,7 +41,7 @@ export default function RootLayout({
/>
</div>
{children}
<AppProvider>{children}</AppProvider>
</body>
</html>
);

View File

@ -9,7 +9,7 @@ import Scores from "@/components/player/Scores";
import { ScoresaberPlayer } from "@/schemas/scoresaber/player";
import { useSettingsStore } from "@/store/settingsStore";
import { SortType, SortTypes } from "@/types/SortTypes";
import { getPlayerInfo } from "@/utils/scoresaber/api";
import { ScoreSaberAPI } from "@/utils/scoresaber/api";
import { useSearchParams } from "next/navigation";
import { useEffect, useState } from "react";
@ -59,7 +59,7 @@ export default function Player({ params }: { params: { id: string } }) {
return;
}
getPlayerInfo(params.id).then((playerResponse) => {
ScoreSaberAPI.getPlayerInfo(params.id).then((playerResponse) => {
if (!playerResponse) {
setError(true);
setErrorMessage("Failed to fetch player. Is the ID correct?");

View File

@ -8,7 +8,7 @@ import { Spinner } from "@/components/Spinner";
import PlayerRanking from "@/components/player/PlayerRanking";
import PlayerRankingMobile from "@/components/player/PlayerRankingMobile";
import { ScoresaberPlayer } from "@/schemas/scoresaber/player";
import { fetchTopPlayers } from "@/utils/scoresaber/api";
import { ScoreSaberAPI } from "@/utils/scoresaber/api";
import { normalizedRegionName } from "@/utils/utils";
import Link from "next/link";
import { useRouter, useSearchParams } from "next/navigation";
@ -53,7 +53,7 @@ export default function RankingCountry({ params }: RankingCountryProps) {
const updatePage = useCallback(
(page: any) => {
console.log("Switching page to", page);
fetchTopPlayers(page, country).then((response) => {
ScoreSaberAPI.fetchTopPlayers(page, country).then((response) => {
if (!response) {
setError(true);
setErrorMessage("No players found");

View File

@ -8,7 +8,7 @@ import { Spinner } from "@/components/Spinner";
import PlayerRanking from "@/components/player/PlayerRanking";
import PlayerRankingMobile from "@/components/player/PlayerRankingMobile";
import { ScoresaberPlayer } from "@/schemas/scoresaber/player";
import { fetchTopPlayers } from "@/utils/scoresaber/api";
import { ScoreSaberAPI } from "@/utils/scoresaber/api";
import { GlobeAsiaAustraliaIcon } from "@heroicons/react/20/solid";
import Link from "next/link";
import { useRouter, useSearchParams } from "next/navigation";
@ -46,7 +46,7 @@ export default function RankingGlobal() {
const updatePage = useCallback(
(page: any) => {
console.log("Switching page to", page);
fetchTopPlayers(page).then((response) => {
ScoreSaberAPI.fetchTopPlayers(page).then((response) => {
if (!response) {
setError(true);
setErrorMessage("No players found");