From cfad4f4a6a00639e72b38d46757d20e08cb0ce28 Mon Sep 17 00:00:00 2001 From: 1emu Date: Thu, 18 Apr 2024 13:21:46 -0300 Subject: [PATCH] chore: switch BrowserRouter to createBrowserRouter --- src/main.tsx | 82 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 49 insertions(+), 33 deletions(-) diff --git a/src/main.tsx b/src/main.tsx index 8cd4c9c..f74fe12 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -4,7 +4,7 @@ import 'semantic-ui-css/semantic.min.css' import React from 'react' import ReactDOM from 'react-dom' import { IntlProvider } from 'react-intl' -import { BrowserRouter, Route, Routes } from 'react-router-dom' +import { Outlet, RouterProvider, createBrowserRouter } from 'react-router-dom' import { QueryClient } from '@tanstack/query-core' import { QueryClientProvider } from '@tanstack/react-query' @@ -51,46 +51,62 @@ import './ui-overrides.css' const queryClient = new QueryClient() const basename = /^decentraland.(zone|org|today)$/.test(window.location.host) ? '/governance-ui' : '/' + +const router = createBrowserRouter( + [ + { + element: , + children: [ + { path: '*', element: }, + { path: '/proposals', element: }, + { path: '/proposal', element: }, + { path: '/projects', element: }, + { path: '/update', element: }, + { path: '/edit/update', element: }, + { path: '/submit', element: }, + { path: '/submit/catalyst', element: }, + { path: '/submit/poi', element: }, + { path: '/submit/ban-name', element: }, + { path: '/submit/linked-wearables', element: }, + { path: '/submit/grant', element: }, + { path: '/submit/hiring', element: }, + { path: '/submit/pitch', element: }, + { path: '/submit/tender', element: }, + { path: '/submit/bid', element: }, + { path: '/submit/poll', element: }, + { path: '/submit/draft', element: }, + { path: '/submit/governance', element: }, + { path: '/submit/update', element: }, + { path: '/profile', element: }, + { path: '/transparency', element: }, + { path: '/debug', element: }, + ], + }, + ], + { basename } +) const component = ( - - - - - - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - - - - + ) +function LayoutShell() { + return ( + <> + + + + + + + + ) +} + ReactDOM.render(component, document.getElementById('root') as HTMLElement)