Skip to content
Snippets Groups Projects
Commit 44320bb8 authored by Jacopo Gasparetto's avatar Jacopo Gasparetto
Browse files

Renamed routes constant to staticRoutes

parent 7e9f3aeb
No related branches found
No related tags found
No related merge requests found
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
......
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 (
......
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 /> }
];
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment