-
Remco Tukker authoredRemco Tukker authored
App.tsx 1.98 KiB
import React, { ReactElement } from "react";
import { createBrowserRouter, RouterProvider } from "react-router-dom";
import Landing from "./pages/Landing";
import ExternalPageNavBar from "./shared/ExternalPageNavBar";
import GeantFooter from "./components/global/GeantFooter";
import BudgetPage from "./pages/Budget";
import CompendiumData from "./pages/CompendiumData";
import FundingSourcePage from "./pages/FundingSource";
import ChargingStructurePage from "./pages/ChargingStructure";
import StaffGraph from "./pages/StaffGraph";
import SubOrganisation from "./pages/SubOrganisation";
import ParentOrganisation from "./pages/ParentOrganisation";
import ECProjects from "./pages/ECProjects";
import Providers from "./Providers";
import PolicyPage from "./pages/Policy";
import TrafficVolumePage from "./pages/TrafficVolumePerNren";
import ConnectedInstitutionsURLs from "./pages/ConnectedInstitutionsURLs";
const router = createBrowserRouter([
{ path: "/budget", element: <BudgetPage />},
{ path: "/funding", element: <FundingSourcePage />},
{ path: "/data/employment", element: <StaffGraph />},
{ path: "/data/roles", element: <StaffGraph roles />},
{ path: "/charging", element: <ChargingStructurePage />},
{ path: "/suborganisations", element: <SubOrganisation />},
{ path: "/parentorganisation", element: <ParentOrganisation />},
{ path: "/ec-projects", element: <ECProjects />},
{ path: "/policy", element: <PolicyPage />},
{ path: "/traffic-volume", element: <TrafficVolumePage />},
{ path: "/data", element: <CompendiumData />},
{ path: "/institutions-urls", element: <ConnectedInstitutionsURLs />},
{ path: "*", element: <Landing />},
]);
function App(): ReactElement {
if (process.env.NODE_ENV === 'production') {
window.location.replace('/survey')
return <></>;
}
return (
<div className="app">
<Providers>
<ExternalPageNavBar />
<RouterProvider router={router} />
</Providers>
<GeantFooter />
</div>
);
}
export default App;