Skip to content

Commit 86beda8

Browse files
authored
Merge pull request #320 from oasisprotocol/mz/footerFix
Show build details in footer
2 parents e31a1d5 + 2832c19 commit 86beda8

4 files changed

Lines changed: 34 additions & 8 deletions

File tree

.changelog/320.bugfix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Show build details in footer

src/components/Layout/Footer.tsx

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,30 @@ export const Footer: FC = () => {
1313

1414
<div className="flex items-center gap-2.5">
1515
<p className="text-xs text-muted-foreground">
16-
<a href="#" rel="noopener noreferrer" target="_blank">
17-
Version {APP_VERSION}
18-
</a>
16+
Version:{' '}
17+
<a
18+
href={`${GITHUB_REPOSITORY_URL}releases/tag/v${APP_VERSION}`}
19+
rel="noopener noreferrer"
20+
target="_blank"
21+
>
22+
{APP_VERSION}
23+
</a>{' '}
24+
<span className="hidden md:inline">
25+
(commit:{' '}
26+
<a
27+
href={`${GITHUB_REPOSITORY_URL}commit/${BUILD_COMMIT}`}
28+
rel="noopener noreferrer"
29+
target="_blank"
30+
>
31+
{BUILD_COMMIT.substring(0, 7)}
32+
</a>
33+
) built on{' '}
34+
{new Intl.DateTimeFormat('en', {
35+
year: 'numeric',
36+
month: 'numeric',
37+
day: 'numeric',
38+
}).format(BUILD_DATETIME)}
39+
</span>
1940
</p>
2041
<span className="text-xs text-muted-foreground">|</span>
2142
<a

src/vite-env.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
declare const APP_VERSION: string
44
declare const BUILD_COMMIT: string
5+
declare const BUILD_DATETIME: number
6+
declare const GITHUB_REPOSITORY_URL: string
57

68
interface ImportMetaEnv {
79
VITE_WALLET_CONNECT_PROJECT_ID: string

vite.config.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { defineConfig } from 'vite';
2-
import react from '@vitejs/plugin-react';
3-
import tailwindcss from '@tailwindcss/vite';
4-
import { version } from './package.json';
1+
import { defineConfig } from 'vite'
2+
import react from '@vitejs/plugin-react'
3+
import tailwindcss from '@tailwindcss/vite'
4+
import { version } from './package.json'
55
import { execSync } from 'node:child_process'
66

77
// https://vite.dev/config/
@@ -10,5 +10,7 @@ export default defineConfig({
1010
define: {
1111
APP_VERSION: JSON.stringify(version),
1212
BUILD_COMMIT: JSON.stringify(execSync('git rev-parse HEAD').toString().trim()),
13+
BUILD_DATETIME: JSON.stringify(new Date().getTime()),
14+
GITHUB_REPOSITORY_URL: JSON.stringify('https://github.com/oasisprotocol/rofl-app/'),
1315
},
14-
});
16+
})

0 commit comments

Comments
 (0)