Skip to content

Commit

Permalink
adds NEXT_PUBLIC_ENABLE_EUDR environmental variable
Browse files Browse the repository at this point in the history
  • Loading branch information
andresgnlez committed Apr 16, 2024
1 parent 664a739 commit f199f7d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
9 changes: 9 additions & 0 deletions client/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ const nextConfig = {
destination: '/auth/signin',
permanent: false,
},
...(process.env.NEXT_PUBLIC_ENABLE_EUDR !== 'true'
? [
{
source: '/eudr',
destination: '/analysis/map',
permanent: false,
},
]
: []),
];
},
env: {
Expand Down
23 changes: 17 additions & 6 deletions client/src/layouts/application/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { CollectionIcon as CollectionIconOutline } from '@heroicons/react/outlin
import { CollectionIcon as CollectionIconSolid } from '@heroicons/react/solid';

// The'ChartBarIcon' fom the modules @heroicons/react are different from the website (and design)

import { ChartBarIconOutline, ChartBarIconSolid } from './icons/chart-bar';

import { useLasTask } from 'hooks/tasks';
Expand Down Expand Up @@ -30,14 +31,24 @@ const ApplicationLayout: React.FC<React.PropsWithChildren> = ({ children }) => {
icon: { default: ChartBarIconOutline, active: ChartBarIconSolid },
disabled: !!(!lastTask || lastTask?.status === 'processing'),
},
...(process.env.NEXT_PUBLIC_ENABLE_EUDR === 'true'
? [
{
name: 'EUDR',
href: '/eudr',
icon: { default: ReportSVG, active: ReportSVG },
disabled: !!(!lastTask || lastTask?.status === 'processing'),
},
]
: []),
];

navigationItems.push({
name: 'EUDR',
href: '/eudr',
icon: { default: ReportSVG, active: ReportSVG },
disabled: !!(!lastTask || lastTask?.status === 'processing'),
});
// navigationItems.push({
// name: 'EUDR',
// href: '/eudr',
// icon: { default: ReportSVG, active: ReportSVG },
// disabled: !!(!lastTask || lastTask?.status === 'processing'),
// });

return (
<div className="min-w-screen-lg flex h-screen min-h-[700px] overflow-hidden bg-navy-600">
Expand Down

0 comments on commit f199f7d

Please sign in to comment.