diff --git a/next.config.js b/next.config.js index e8d4fb5..a0d9835 100644 --- a/next.config.js +++ b/next.config.js @@ -1,7 +1,12 @@ +const nextBuildId = require("next-build-id"); + /** @type {import('next').NextConfig} */ const nextConfig = { generateEtags: true, compress: true, + env: { + NEXT_PUBLIC_BUILD_ID: nextBuildId.sync({ dir: __dirname }), + }, images: { remotePatterns: [ { diff --git a/package-lock.json b/package-lock.json index bf81c61..21c2d22 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,7 @@ "encoding": "^0.1.13", "moment": "^2.29.4", "next": "13.5.6", + "next-build-id": "^3.0.0", "node-fetch-cache": "^3.1.3", "react": "^18", "react-country-flag": "^3.1.0", @@ -3411,6 +3412,14 @@ } } }, + "node_modules/next-build-id": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/next-build-id/-/next-build-id-3.0.0.tgz", + "integrity": "sha512-B3JCsL/9Z/wkmo3EySukQHCgx89Aw0i4LPi2MEhCboQBJ6wpkYTIu1z6hOYKuw/S1Wy8ZRqCEq0dVY/ST6jGqg==", + "engines": { + "node": ">=8" + } + }, "node_modules/node-abi": { "version": "3.51.0", "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.51.0.tgz", diff --git a/package.json b/package.json index 118707c..c44a028 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "encoding": "^0.1.13", "moment": "^2.29.4", "next": "13.5.6", + "next-build-id": "^3.0.0", "node-fetch-cache": "^3.1.3", "react": "^18", "react-country-flag": "^3.1.0", diff --git a/src/app/player/[id]/page.tsx b/src/app/player/[id]/page.tsx index aab2dd4..38366ae 100644 --- a/src/app/player/[id]/page.tsx +++ b/src/app/player/[id]/page.tsx @@ -96,7 +96,7 @@ export default function Player({ params }: { params: { id: string } }) { return (
-
+
{player.loading && } @@ -127,7 +127,7 @@ export default function Player({ params }: { params: { id: string } }) {
{/* Player Info */} -
+
@@ -184,7 +184,7 @@ export default function Player({ params }: { params: { id: string } }) {
{/* Scores */} -
+
{scores.loading ? (
@@ -249,7 +249,7 @@ export default function Player({ params }: { params: { id: string } }) {
{/* Pagination */} -
+
-
+
-
- - {children} +
+ +
{children}
+ +
); diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx new file mode 100644 index 0000000..2d61785 --- /dev/null +++ b/src/components/Footer.tsx @@ -0,0 +1,44 @@ +import { isProduction } from "@/utils/utils"; + +const buttons = [ + { + name: "Privacy", + url: "/privacy", + }, +]; + +const buildId = process.env.NEXT_PUBLIC_BUILD_ID + ? process.env.NEXT_PUBLIC_BUILD_ID.slice(0, 7) + + (isProduction() ? "" : "-dev") + : ""; + +export default function Footer() { + return ( +
+
+
+

Scoresaber Reloaded

+ + {buttons.map((button, index) => { + return ( + + ); + })} +
+ +
Build ID: {buildId}
+
+
+ ); +} diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index ca69f8b..99ed02d 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -17,7 +17,7 @@ function NavbarButton({ text, icon, href, children }: ButtonProps) { return (
<> @@ -27,7 +27,7 @@ function NavbarButton({ text, icon, href, children }: ButtonProps) { {children && ( -
+
{children}
)} @@ -38,7 +38,7 @@ function NavbarButton({ text, icon, href, children }: ButtonProps) { export default function Navbar() { return ( <> -
+
}>

No friends, add someone!

diff --git a/src/components/SearchPlayer.tsx b/src/components/SearchPlayer.tsx index ed38abc..f39355c 100644 --- a/src/components/SearchPlayer.tsx +++ b/src/components/SearchPlayer.tsx @@ -54,14 +54,14 @@ export default function SearchPlayer() {