From 44320bb860e45123d01835d6c4880740d3b18362 Mon Sep 17 00:00:00 2001 From: Jacopo Gasparetto <jacopo.gasparetto@cnaf.infn.it> Date: Fri, 7 Apr 2023 12:07:59 +0200 Subject: [PATCH] Renamed routes constant to staticRoutes --- frontend/src/App.tsx | 4 ++-- frontend/src/components/Drawer.tsx | 4 ++-- frontend/src/routes/index.tsx | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 4cd8e40..a98b4be 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1,7 +1,7 @@ import { createBrowserRouter, RouterProvider } from 'react-router-dom'; import { useState, useEffect } from 'react'; import { BucketInfo } from './models/bucket'; -import { routes } from './routes'; +import { staticRouts } from './routes'; import APIService from './services/APIService'; import { BucketsListContext } from './services/BucketListContext'; @@ -22,7 +22,7 @@ function App() { }, [isAuthenticated]); - const router = createBrowserRouter(routes.map(route => { + const router = createBrowserRouter(staticRouts.map(route => { return { path: route.path, element: route.element diff --git a/frontend/src/components/Drawer.tsx b/frontend/src/components/Drawer.tsx index 8e9a44f..73d9395 100644 --- a/frontend/src/components/Drawer.tsx +++ b/frontend/src/components/Drawer.tsx @@ -1,9 +1,9 @@ -import { routes } from '../routes'; +import { staticRouts } from '../routes'; import { Link } from 'react-router-dom'; export const Drawer = () => { const path = window.location.pathname; - const links = routes.map(route => { + const links = staticRouts.map(route => { let className = "h-10 hover:bg-neutral-300 rounded-lg p-2"; className += route.path === path ? " bg-neutral-200" : ""; return ( diff --git a/frontend/src/routes/index.tsx b/frontend/src/routes/index.tsx index 97eafc6..db3e485 100644 --- a/frontend/src/routes/index.tsx +++ b/frontend/src/routes/index.tsx @@ -1,4 +1,4 @@ -import React, { ReactNode } from 'react'; +import { ReactNode } from 'react'; import { Home } from './Home'; import { Buckets } from './Buckets'; @@ -8,7 +8,7 @@ export type Route = { element: ReactNode } -export const routes: Route[] = [ +export const staticRouts: Route[] = [ { title: "Home", path: "/", element: <Home /> }, { title: "Buckets", path: "/buckets", element: <Buckets /> } ]; -- GitLab