Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions apps/frontend/next.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
// @ts-check
import fs from 'fs';
import path from 'path';
import { withSentryConfig } from '@sentry/nextjs';

const versionFile = path.join(process.cwd(), 'version.txt');
const appVersion = process.env.NEXT_PUBLIC_APP_VERSION
? process.env.NEXT_PUBLIC_APP_VERSION
: fs.existsSync(versionFile)
? fs.readFileSync(versionFile, 'utf8').trim()
: '0.0.0';

/** @type {import('next').NextConfig} */
const nextConfig = {
env: {
NEXT_PUBLIC_APP_VERSION: appVersion,
},
experimental: {
proxyTimeout: 90_000,
},
Expand Down
4 changes: 4 additions & 0 deletions apps/frontend/src/components/settings/global.settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ const MetricComponent = dynamic(
);
export const GlobalSettings = () => {
const t = useT();
const appVersion = process.env.NEXT_PUBLIC_APP_VERSION || 'dev';
return (
<div className="flex flex-col">
<h3 className="text-[20px]">{t('global_settings', 'Global Settings')}</h3>
<MetricComponent />
<div className="mt-[32px] text-[12px] text-textColor opacity-60">
{t('app_version', 'App Version')}: <span className="font-mono">{appVersion}</span>
</div>
</div>
);
};