Updated Sidebar to pull from NEXT_PUBLIC_BUILD_ENV instead of NODE.

This commit is contained in:
Bailey Taylor
2025-09-22 03:41:49 +00:00
parent ba007ac862
commit f0d8a26f57
5 changed files with 22 additions and 21 deletions

2
.gitignore vendored
View File

@@ -39,3 +39,5 @@ yarn-error.log*
# typescript # typescript
*.tsbuildinfo *.tsbuildinfo
next-env.d.ts next-env.d.ts
certificate (5).zip
.gitea/workflows/deploy.yml

View File

@@ -13,7 +13,8 @@ const nextConfig: NextConfig = {
allowedDevOrigins: [ allowedDevOrigins: [
'http://localhost:3000', 'http://localhost:3000',
'http://172.16.10.180:3000', 'http://172.16.10.180:3000',
'https://dev.psg.net.au', 'dev.psg.net.au',
'https://sys.psg.net.au',
], ],
productionBrowserSourceMaps: false, productionBrowserSourceMaps: false,

1
package-lock.json generated
View File

@@ -2535,7 +2535,6 @@
"resolved": "https://registry.npmjs.org/@types/react-window/-/react-window-1.8.8.tgz", "resolved": "https://registry.npmjs.org/@types/react-window/-/react-window-1.8.8.tgz",
"integrity": "sha512-8Ls660bHR1AUA2kuRvVG9D/4XpRC6wjAaPT9dil7Ckc76eP9TKWZwwmgfq8Q1LANX3QNDnoU4Zp48A3w+zK69Q==", "integrity": "sha512-8Ls660bHR1AUA2kuRvVG9D/4XpRC6wjAaPT9dil7Ckc76eP9TKWZwwmgfq8Q1LANX3QNDnoU4Zp48A3w+zK69Q==",
"dev": true, "dev": true,
"license": "MIT",
"dependencies": { "dependencies": {
"@types/react": "*" "@types/react": "*"
} }

View File

@@ -3,15 +3,14 @@
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "next dev --hostname 0.0.0.0 --port 3000", "dev": "next dev --hostname 0.0.0.0 --port 3000",
"dev:https": "cross-env NODE_ENV=development next dev --experimental-https --experimental-https-cert /etc/frontend/certs/dev.crt --experimental-https-key /etc/frontend/certs/dev.key --hostname 0.0.0.0 --port 3000", "dev:https": "cross-env NODE_ENV=development next dev --experimental-https --experimental-https-cert /etc/frontend/certs/dev.crt --experimental-https-key /etc/frontend/certs/dev.key --hostname 0.0.0.0 --port 3000",
"dev:custom": "cross-env NODE_ENV=development node --loader ts-node/esm server.ts", "dev:custom": "cross-env NODE_ENV=development node --loader ts-node/esm server.ts",
"build": "next build", "build": "next build",
"start": "next start", "start": "next start",
"start:prod": "cross-env PORT=3001 next start", "lint": "next lint"
"lint": "next lint" },
},
"dependencies": { "dependencies": {
"@emotion/react": "^11.14.0", "@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.0", "@emotion/styled": "^11.14.0",

View File

@@ -38,7 +38,7 @@ import { useAuth } from '@/context/AuthContext';
const collapsedDrawerWidth = 65; const collapsedDrawerWidth = 65;
const drawerWidth = 240; const drawerWidth = 240;
const isDev = process.env.NODE_ENV === 'development'; const isDev = process.env.NEXT_PUBLIC_BUILD_ENV === 'dev';
const openedMixin = (theme: Theme): CSSObject => ({ const openedMixin = (theme: Theme): CSSObject => ({
@@ -180,15 +180,15 @@ export default function SidebarLayout({ children }: { children: React.ReactNode
{/* Right-aligned build label */} {/* Right-aligned build label */}
<Typography <Typography
variant="subtitle2" variant="subtitle2"
sx={{ sx={{
fontWeight: 'bold', fontWeight: 'bold',
color: isDev ? 'error.main' : 'success.main', color: isDev ? 'error.main' : 'success.main',
letterSpacing: 1, letterSpacing: 1,
}} }}
> >
{isDev ? 'DEVELOPMENT BUILD' : 'LIVE BUILD'} {isDev ? 'DEVELOPMENT BUILD' : 'LIVE BUILD'}
</Typography> </Typography>
</Toolbar> </Toolbar>
</AppBar> </AppBar>