Spaces:
Sleeping
Sleeping
import React from 'react'; | |
import ReactDOM from 'react-dom/client'; | |
import { createBrowserRouter, RouterProvider } from 'react-router-dom'; | |
import 'bootstrap/dist/css/bootstrap.min.css'; | |
import './styles/index.css'; | |
import './styles/styles.css'; | |
import ErrorPage from './pages/ErrorPage'; | |
import HomePage from './pages/user-pages/HomePage'; | |
import reportWebVitals from './reportWebVitals'; | |
import LoginPage from './pages/user-pages/LoginPage'; | |
import RegisterPage from './pages/user-pages/RegisterPage'; | |
import NewsPage from './pages/user-pages/NewsPage'; | |
import MenuPage from './pages/user-pages/MenuPage'; | |
import CartPage from './pages/user-pages/CartPage'; | |
import UserInfoPage from './pages/user-pages/UserInfoPage'; | |
import AdminSummaryPage from './pages/admin-pages/AdminSummaryPage'; | |
import AdminFeedPage from './pages/admin-pages/AdminFeedPage'; | |
import AdminMenuPage from './pages/admin-pages/AdminMenuPage'; | |
import AdminStaffPage from './pages/admin-pages/AdminStaffPage'; | |
import AdminOrderPage from './pages/admin-pages/AdminOrderPage'; | |
import AdminSchedulePage from './pages/admin-pages/AdminSchedulePage'; | |
import AdminLoginPage from './pages/admin-pages/AdminLoginPage'; | |
import AdminUserInfoPage from './pages/admin-pages/AdminUserInfoPage'; | |
import AdminNewsEditPage from './pages/admin-pages/AdminNewsEditPage'; | |
import AdminBranchPage from './pages/admin-pages/AdminBranchesPage'; | |
import AdminBranchEditPage from './pages/admin-pages/AdminBranchesEditPage'; | |
import AdminMenuEditPage from './pages/admin-pages/AdminMenuEditPage'; | |
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 /> | |
}, | |
{ | |
path: "/cart", | |
element: <CartPage />, | |
errorElement: <ErrorPage /> | |
}, | |
{ | |
path: "/userinfo", | |
element: <UserInfoPage />, | |
errorElement: <ErrorPage /> | |
}, | |
// admin section | |
{ | |
path: "/admin", | |
element: <AdminSummaryPage />, | |
errorElement: <ErrorPage /> | |
}, | |
{ | |
path: "/admin-summary", | |
element: <AdminSummaryPage />, | |
errorElement: <ErrorPage /> | |
}, | |
{ | |
path: "/admin-feed", | |
element: <AdminFeedPage />, | |
errorElement: <ErrorPage /> | |
}, | |
{ | |
path: "/admin-schedule", | |
element: <AdminSchedulePage />, | |
errorElement: <ErrorPage /> | |
}, | |
{ | |
path: "/admin-menu", | |
element: <AdminMenuPage />, | |
errorElement: <ErrorPage /> | |
}, | |
{ | |
path: "/admin-staff", | |
element: <AdminStaffPage />, | |
errorElement: <ErrorPage /> | |
}, | |
{ | |
path: "/admin-orders", | |
element: <AdminOrderPage />, | |
errorElement: <ErrorPage /> | |
}, | |
{ | |
path: "/admin-login", | |
element: <AdminLoginPage />, | |
errorElement: <ErrorPage /> | |
}, | |
{ | |
path:"/admin-info", | |
element: <AdminUserInfoPage/>, | |
errorElement: <ErrorPage/> | |
}, | |
{ | |
path:"/admin-news", | |
element: <AdminNewsEditPage/>, | |
errorElement: <ErrorPage/> | |
}, | |
{ | |
path:"/admin-branchs-list", | |
element: <AdminBranchPage/>, | |
errorElement: <ErrorPage/> | |
}, | |
{ | |
path:"/admin-branchs", | |
element: <AdminBranchEditPage/>, | |
errorElement: <ErrorPage/> | |
}, | |
{ | |
path:"/admin-menu-edit", | |
element: <AdminMenuEditPage/>, | |
errorElement: <ErrorPage/> | |
} | |
]); | |
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(); | |