feat: statusbalk met versie en builddatum
Voegt sticky statusbalk toe aan de onderkant van de app met: - Copyright melding - App-versie uit package.json (NEXT_PUBLIC_APP_VERSION) - Builddatum ingesteld op het moment van de build (NEXT_PUBLIC_BUILD_DATE) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
0bf635eca1
commit
71e4ebc22d
3 changed files with 29 additions and 5 deletions
|
|
@ -4,6 +4,7 @@ import { getIronSession } from 'iron-session'
|
||||||
import { SessionData, sessionOptions } from '@/lib/session'
|
import { SessionData, sessionOptions } from '@/lib/session'
|
||||||
import { NavBar } from '@/components/shared/nav-bar'
|
import { NavBar } from '@/components/shared/nav-bar'
|
||||||
import { MinWidthBanner } from '@/components/shared/min-width-banner'
|
import { MinWidthBanner } from '@/components/shared/min-width-banner'
|
||||||
|
import { StatusBar } from '@/components/shared/status-bar'
|
||||||
|
|
||||||
export default async function AppLayout({ children }: { children: React.ReactNode }) {
|
export default async function AppLayout({ children }: { children: React.ReactNode }) {
|
||||||
const session = await getIronSession<SessionData>(await cookies(), sessionOptions)
|
const session = await getIronSession<SessionData>(await cookies(), sessionOptions)
|
||||||
|
|
@ -19,9 +20,10 @@ export default async function AppLayout({ children }: { children: React.ReactNod
|
||||||
</a>
|
</a>
|
||||||
<NavBar isDemo={session.isDemo} />
|
<NavBar isDemo={session.isDemo} />
|
||||||
<MinWidthBanner />
|
<MinWidthBanner />
|
||||||
<main id="main-content" className="flex-1 flex flex-col">
|
<main id="main-content" className="flex-1 flex flex-col overflow-hidden">
|
||||||
{children}
|
{children}
|
||||||
</main>
|
</main>
|
||||||
|
<StatusBar />
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
18
components/shared/status-bar.tsx
Normal file
18
components/shared/status-bar.tsx
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
const buildDate = process.env.NEXT_PUBLIC_BUILD_DATE
|
||||||
|
? new Date(process.env.NEXT_PUBLIC_BUILD_DATE).toLocaleDateString('nl-NL', {
|
||||||
|
day: 'numeric',
|
||||||
|
month: 'short',
|
||||||
|
year: 'numeric',
|
||||||
|
})
|
||||||
|
: '—'
|
||||||
|
|
||||||
|
const version = process.env.NEXT_PUBLIC_APP_VERSION ?? '0.0.0'
|
||||||
|
|
||||||
|
export function StatusBar() {
|
||||||
|
return (
|
||||||
|
<footer className="shrink-0 border-t border-border bg-surface-container-low px-4 py-1 flex items-center justify-between text-[10px] text-muted-foreground select-none">
|
||||||
|
<span>© {new Date().getFullYear()} Scrum4Me</span>
|
||||||
|
<span>v{version} · gebouwd op {buildDate}</span>
|
||||||
|
</footer>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
@ -1,7 +1,11 @@
|
||||||
import type { NextConfig } from "next";
|
import type { NextConfig } from "next"
|
||||||
|
import pkg from "./package.json"
|
||||||
|
|
||||||
const nextConfig: NextConfig = {
|
const nextConfig: NextConfig = {
|
||||||
/* config options here */
|
env: {
|
||||||
};
|
NEXT_PUBLIC_APP_VERSION: pkg.version,
|
||||||
|
NEXT_PUBLIC_BUILD_DATE: new Date().toISOString(),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
export default nextConfig;
|
export default nextConfig
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue