diff --git a/src/frontend/src/router.tsx b/src/frontend/src/router.tsx index 314efd23a8..3ee7fb7843 100644 --- a/src/frontend/src/router.tsx +++ b/src/frontend/src/router.tsx @@ -1,5 +1,5 @@ import { lazy } from 'react'; -import { createBrowserRouter } from 'react-router-dom'; +import { Route, Routes } from 'react-router-dom'; import { Loadable } from './functions/loading'; @@ -58,100 +58,37 @@ export const Set_Password = Loadable( ); // Routes -export const router = createBrowserRouter( - [ - { - path: '*', - element: , - errorElement: - }, - { - path: '/', - element: , - errorElement: , - children: [ - { - index: true, - element: - }, - { - path: 'home/', - element: - }, - { - path: 'dashboard/', - element: - }, - { - path: 'notifications/', - element: - }, - { - path: 'playground/', - element: - }, - { - path: 'scan', - element: - }, - { - path: 'part/', - element: - }, - { - path: 'part/category/:id', - element: - }, - { - path: 'part/:id', - element: - }, - { - path: 'stock/', - element: - }, - { - path: 'stock/location/:id', - element: - }, - { - path: 'stock/item/:id', - element: - }, - { - path: 'build/', - element: - }, - { - path: 'build/:id', - element: - }, - { - path: '/profile/:tabValue', - element: - } - ] - }, - { - path: '/login', - element: , - errorElement: - }, - { - path: '/logged-in', - element: , - errorElement: - }, - { - path: '/reset-password', - element: , - errorElement: - }, - { - path: '/set-password', - element: , - errorElement: - } - ], - { basename: '/platform' } +export const routes = ( + + } errorElement={} /> + } errorElement={}> + } />, + } />, + } />, + } />, + } />, + } />, + + } /> + } /> + } /> + + + } /> + } /> + } /> + + + } /> + } /> + + } /> + + }> + } />, + } /> + } /> + } /> + + ); diff --git a/src/frontend/src/views/DesktopAppView.tsx b/src/frontend/src/views/DesktopAppView.tsx index 5dd6a310bd..eb3027c3e8 100644 --- a/src/frontend/src/views/DesktopAppView.tsx +++ b/src/frontend/src/views/DesktopAppView.tsx @@ -1,11 +1,11 @@ import { QueryClientProvider } from '@tanstack/react-query'; import { useEffect, useState } from 'react'; -import { RouterProvider } from 'react-router-dom'; +import { BrowserRouter } from 'react-router-dom'; import { queryClient, setApiDefaults } from '../App'; import { BaseContext } from '../contexts/BaseContext'; import { defaultHostList } from '../defaults/defaultHostList'; -import { router } from '../router'; +import { routes } from '../router'; import { useApiState } from '../states/ApiState'; import { useLocalState } from '../states/LocalState'; import { useSessionState } from '../states/SessionState'; @@ -35,7 +35,7 @@ export default function DesktopAppView() { return ( - + {routes} );