diff --git a/packages/interface/package.json b/packages/interface/package.json index 37250d78..f3acd29f 100644 --- a/packages/interface/package.json +++ b/packages/interface/package.json @@ -3,6 +3,7 @@ "version": "0.1.0", "private": true, "scripts": { + "prebuild": "EXPORT NEXT_PUBLIC_COMMIT_HASH=`git log --pretty=format:'%h' -n`", "build": "next build", "dev": "next dev", "lint": "next lint", diff --git a/packages/interface/src/components/Footer.tsx b/packages/interface/src/components/Footer.tsx index 574d6708..340475c5 100644 --- a/packages/interface/src/components/Footer.tsx +++ b/packages/interface/src/components/Footer.tsx @@ -2,6 +2,8 @@ import Image from "next/image"; import { FaGithub, FaDiscord } from "react-icons/fa"; import { FaXTwitter } from "react-icons/fa6"; +import { config } from "~/config"; + import { Logo } from "./ui/Logo"; export const Footer = (): JSX.Element => ( @@ -26,6 +28,8 @@ export const Footer = (): JSX.Element => (
+

Git Version: {config.commitHash}

+ Docs diff --git a/packages/interface/src/config.ts b/packages/interface/src/config.ts index 2690bee0..ffee87a0 100644 --- a/packages/interface/src/config.ts +++ b/packages/interface/src/config.ts @@ -86,6 +86,7 @@ export const config = { roundLogo: process.env.NEXT_PUBLIC_ROUND_LOGO, semaphoreSubgraphUrl: process.env.NEXT_PUBLIC_SEMAPHORE_SUBGRAPH, treeUrl: process.env.NEXT_PUBLIC_TREE_URL, + commitHash: process.env.NEXT_PUBLIC_COMMIT_HASH, }; export const theme = { diff --git a/packages/interface/src/env.js b/packages/interface/src/env.js index 7221d7c6..110f7fa8 100644 --- a/packages/interface/src/env.js +++ b/packages/interface/src/env.js @@ -52,6 +52,8 @@ module.exports = createEnv({ NEXT_PUBLIC_SEMAPHORE_SUBGRAPH: z.string().url().optional(), NEXT_PUBLIC_TREE_URL: z.string().url().optional(), + + NEXT_PUBLIC_COMMIT_HASH: z.string(), }, /** @@ -83,6 +85,8 @@ module.exports = createEnv({ NEXT_PUBLIC_SEMAPHORE_SUBGRAPH: process.env.NEXT_PUBLIC_SEMAPHORE_SUBGRAPH, NEXT_PUBLIC_TREE_URL: process.env.NEXT_PUBLIC_TREE_URL, + + NEXT_PUBLIC_COMMIT_HASH: process.env.NEXT_PUBLIC_COMMIT_HASH, }, /** * Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially diff --git a/packages/interface/src/pages/coordinator/index.tsx b/packages/interface/src/pages/coordinator/index.tsx index 0a3995d8..45f2f6fc 100644 --- a/packages/interface/src/pages/coordinator/index.tsx +++ b/packages/interface/src/pages/coordinator/index.tsx @@ -1,5 +1,14 @@ +import { config } from "~/config"; import { Layout } from "~/layouts/DefaultLayout"; -const CoordinatorPage = (): JSX.Element => This is the coordinator page.; +const CoordinatorPage = (): JSX.Element => ( + +
+

This is the coordinator page.

+ +

You are using version with commit: {config.commitHash}

+
+
+); export default CoordinatorPage;