From be998f068cf1275ac768dc379c4642e115bedbb3 Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 6 Nov 2023 17:40:54 +0000 Subject: [PATCH] add build time --- next.config.js | 8 ++++++++ src/components/Footer.tsx | 13 +++++++++---- src/components/overlay/SongInfo.tsx | 2 +- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/next.config.js b/next.config.js index 776a365..543ddc9 100644 --- a/next.config.js +++ b/next.config.js @@ -10,6 +10,13 @@ const nextConfig = { env: { NEXT_PUBLIC_BUILD_ID: process.env.GIT_REV || nextBuildId.sync({ dir: __dirname }), + NEXT_PUBLIC_BUILD_TIME: new Date().toLocaleDateString("en-US", { + year: "numeric", + month: "long", + day: "numeric", + hour: "numeric", + minute: "numeric", + }), }, images: { remotePatterns: [ @@ -58,6 +65,7 @@ module.exports = withBundleAnalyzer(nextConfig); // // Injected content via Sentry wizard below const { withSentryConfig } = require("@sentry/nextjs"); +const { format } = require("path"); module.exports = withSentryConfig( module.exports, diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx index 6733383..bee132c 100644 --- a/src/components/Footer.tsx +++ b/src/components/Footer.tsx @@ -15,9 +15,14 @@ const buttons = [ ]; const buildId = process.env.NEXT_PUBLIC_BUILD_ID - ? process.env.NEXT_PUBLIC_BUILD_ID.slice(0, 7) + - (isProduction() ? "" : "-dev") + ? isProduction() + ? process.env.NEXT_PUBLIC_BUILD_ID.slice(0, 7) + : "dev" : ""; +const buildTime = process.env.NEXT_PUBLIC_BUILD_TIME; +const gitUrl = isProduction() + ? `https://git.fascinated.cc/Fascinated/scoresaber-reloaded-v2/commit/${buildId}` + : "https://git.fascinated.cc/Fascinated/scoresaber-reloaded-v2"; export default function Footer() { return ( @@ -52,10 +57,10 @@ export default function Footer() { - Build ID: {buildId} + Build ID: {buildId} ({buildTime}) diff --git a/src/components/overlay/SongInfo.tsx b/src/components/overlay/SongInfo.tsx index 1f943c2..e76fdb9 100644 --- a/src/components/overlay/SongInfo.tsx +++ b/src/components/overlay/SongInfo.tsx @@ -14,7 +14,7 @@ export default function SongInfo() {