Skip to content

Commit a49fdc8

Browse files
fix: web sidebar version linking (#628)
1 parent fe3bd15 commit a49fdc8

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

apps/web/src/app/[orgShortcode]/_components/sidebar-content.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ export default function SidebarContent() {
8383
</div>
8484
<div className="flex w-full flex-row items-center justify-between p-1">
8585
<span className={cn('font-display text-base-11 text-sm')}>UnInbox</span>
86-
<span className={cn('text-base-11 text-xs')}>v0.1.0</span>
86+
<span className={cn('text-base-11 text-xs')}>
87+
v{env.NEXT_PUBLIC_APP_VERSION}
88+
</span>
8789
</div>
8890
</div>
8991
);

apps/web/src/env.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ if (!IS_BROWSER) {
1111
? 'true'
1212
: 'false';
1313

14+
process.env.APP_VERSION = process.env.npm_package_version;
15+
1416
// DON'T ADD ANY SENSITIVE ENVIRONMENT VARIABLES HERE
1517
// All variables defined here will be exposed to the client
1618
const PUBLIC_ENV_LIST = [
@@ -21,7 +23,8 @@ if (!IS_BROWSER) {
2123
'REALTIME_HOST',
2224
'REALTIME_PORT',
2325
'TURNSTILE_SITE_KEY',
24-
'EE_ENABLED'
26+
'EE_ENABLED',
27+
'APP_VERSION'
2528
];
2629

2730
PUBLIC_ENV_LIST.forEach((key) => {
@@ -41,7 +44,8 @@ export const env = createEnv({
4144
NEXT_PUBLIC_REALTIME_HOST: z.string(),
4245
NEXT_PUBLIC_REALTIME_PORT: z.coerce.number(),
4346
NEXT_PUBLIC_TURNSTILE_SITE_KEY: z.string().optional(),
44-
NEXT_PUBLIC_EE_ENABLED: z.enum(['true', 'false'])
47+
NEXT_PUBLIC_EE_ENABLED: z.enum(['true', 'false']),
48+
NEXT_PUBLIC_APP_VERSION: z.string().default('development')
4549
},
4650
// process.env is added here to allow access while on server, it is tree-shaken out in the browser
4751
// if you check in the browser, you will see runtimeEnv is set to window.__ENV only

0 commit comments

Comments
 (0)