feat: Ajout du suivi de version dans le footer du Front

This commit is contained in:
Luc SORIGNET
2025-02-10 08:58:02 +01:00
parent 274db249aa
commit fb7fbaf839
2 changed files with 7 additions and 3 deletions

View File

@ -1,4 +1,5 @@
import createNextIntlPlugin from 'next-intl/plugin'; import createNextIntlPlugin from 'next-intl/plugin';
import pkg from "./package.json" assert { type: "json" };
const withNextIntl = createNextIntlPlugin(); const withNextIntl = createNextIntlPlugin();
@ -7,6 +8,9 @@ const nextConfig = {
experimental: { experimental: {
instrumentationHook: true, instrumentationHook: true,
}, },
env: {
NEXT_PUBLIC_APP_VERSION: pkg.version,
},
}; };
export default withNextIntl(nextConfig); export default withNextIntl(nextConfig);

View File

@ -46,7 +46,7 @@ export default function Layout({
const headerTitle = sidebarItems[currentPage]?.name || t('dashboard'); const headerTitle = sidebarItems[currentPage]?.name || t('dashboard');
const softwareName = "N3WT School"; const softwareName = "N3WT School";
const softwareVersion = "v1.0.0"; const softwareVersion = `v${process.env.NEXT_PUBLIC_APP_VERSION}`;
const dropdownItems = [ const dropdownItems = [
@ -80,9 +80,9 @@ export default function Layout({
</div> </div>
{/* Footer - h-16 = 64px */} {/* Footer - h-16 = 64px */}
<footer className="h-16 bg-white border-t border-gray-200 px-8 py-4 flex items-center justify-between"> <footer className="h-16 bg-white border-t border-gray-200 px-8 py-4 flex items-center justify-between">
<div> <div className="text-sm font-light">
<span>&copy; {new Date().getFullYear()} N3WT-INNOV Tous droits réservés.</span> <span>&copy; {new Date().getFullYear()} N3WT-INNOV Tous droits réservés.</span>
<div>{softwareName} - {softwareVersion}</div> <div className="text-sm font-light">{softwareName} - {softwareVersion}</div>
</div> </div>
<Logo className="w-8 h-8" /> <Logo className="w-8 h-8" />
</footer> </footer>