Spaces:
Sleeping
Sleeping
import React from 'react'; | |
import ReactDOM from 'react-dom/client'; | |
import { createBrowserRouter, RouterProvider } from 'react-router-dom'; | |
import './styles/index.css'; | |
import 'bootstrap/dist/css/bootstrap.min.css'; | |
import ErrorPage from './pages/ErrorPage'; | |
import HomePage from './pages/HomePage'; | |
import reportWebVitals from './reportWebVitals'; | |
import LoginPage from './pages/LoginPage'; | |
import RegisterPage from './pages/RegisterPage'; | |
import NewsPage from './pages/NewsPage'; | |
import MenuPage from './pages/MenuPage'; | |
const router = createBrowserRouter([ | |
{ | |
path: "/", | |
element: <HomePage />, | |
errorElement: <ErrorPage />, | |
}, | |
{ | |
path: "/login", | |
element: <LoginPage />, | |
errorElement: <ErrorPage /> | |
}, | |
{ | |
path: "/register", | |
element: <RegisterPage/>, | |
errorElement: <ErrorPage/> | |
}, | |
{ | |
path: "/news", | |
element: <NewsPage/>, | |
errorElement: <ErrorPage/> | |
}, | |
{ | |
path: "/menu", | |
element: <MenuPage/> | |
} | |
]); | |
const root = ReactDOM.createRoot(document.getElementById('root')); | |
root.render( | |
<React.StrictMode> | |
<RouterProvider router={router}/> | |
</React.StrictMode> | |
); | |
// If you want to start measuring performance in your app, pass a function | |
// to log results (for example: reportWebVitals(console.log)) | |
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals | |
reportWebVitals(); | |