From 319c4c13eace6496b8dc7603b7c1cc0e0095ae22 Mon Sep 17 00:00:00 2001 From: Liam Date: Sun, 22 Oct 2023 08:36:08 +0100 Subject: [PATCH] add config file --- src/app/layout.tsx | 9 +++++---- src/components/Footer.tsx | 3 ++- src/ssrSettings.ts | 5 +++++ src/utils/scoresaber/api.ts | 3 ++- 4 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 src/ssrSettings.ts diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 7191998..a024488 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,4 +1,5 @@ import AppProvider from "@/components/AppProvider"; +import { SSRSettings } from "@/ssrSettings"; import { Metadata } from "next"; import { Inter } from "next/font/google"; import Image from "next/image"; @@ -9,13 +10,13 @@ const font = Inter({ subsets: ["latin-ext"], weight: "500" }); export const metadata: Metadata = { title: { - template: "Scoresaber Reloaded - %s", - default: "Scoresaber Reloaded", + template: SSRSettings.siteName + " - %s", + default: SSRSettings.siteName, }, openGraph: { - title: "Scoresaber Reloaded", + title: SSRSettings.siteName, description: "Aggregate your scores with other leaderboards together!", - url: "https://ssr.fascinated.cc", + url: SSRSettings.siteUrl, locale: "en_US", type: "website", }, diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx index 4de19ea..c3aa990 100644 --- a/src/components/Footer.tsx +++ b/src/components/Footer.tsx @@ -1,3 +1,4 @@ +import { SSRSettings } from "@/ssrSettings"; import { isProduction } from "@/utils/utils"; const buttons = [ @@ -21,7 +22,7 @@ export default function Footer() { className="transform-gpu transition-all hover:text-blue-500" href="https://git.fascinated.cc/Fascinated/scoresaber-reloaded-v2" > - Scoresaber Reloaded + {SSRSettings.siteName} {buttons.map((button, index) => { diff --git a/src/ssrSettings.ts b/src/ssrSettings.ts new file mode 100644 index 0000000..41e37d4 --- /dev/null +++ b/src/ssrSettings.ts @@ -0,0 +1,5 @@ +export const SSRSettings = { + siteName: "Scoresaber Reloaded", + siteUrl: "https://ssr.fascinated.cc", + proxy: "https://proxy.fascinated.cc", +}; diff --git a/src/utils/scoresaber/api.ts b/src/utils/scoresaber/api.ts index 991427d..92978fa 100644 --- a/src/utils/scoresaber/api.ts +++ b/src/utils/scoresaber/api.ts @@ -1,5 +1,6 @@ import { ScoresaberPlayer } from "@/schemas/scoresaber/player"; import { ScoresaberPlayerScore } from "@/schemas/scoresaber/playerScore"; +import { SSRSettings } from "@/ssrSettings"; import { FetchQueue } from "../fetchWithQueue"; import { formatString } from "../string"; @@ -7,7 +8,7 @@ import { formatString } from "../string"; const fetchQueue = new FetchQueue(); // Api endpoints -const API_URL = "https://proxy.fascinated.cc/https://scoresaber.com/api"; +const API_URL = SSRSettings.proxy + "/https://scoresaber.com/api"; const SEARCH_PLAYER_URL = API_URL + "/players?search={}&page=1&withMetadata=false"; const PLAYER_SCORES =