You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
2.0 KiB
JavaScript
65 lines
2.0 KiB
JavaScript
import React from "react";
|
|
import { configure } from "mobx";
|
|
import ReactDOM from "react-dom/client";
|
|
import {
|
|
createBrowserRouter,
|
|
RouterProvider,
|
|
} from "react-router-dom";
|
|
import RootStore from "@/stores/Root";
|
|
import { StoreContext } from '@/stores/StoreContext';
|
|
import "@/assets/global.css";
|
|
import App from "@/views/App";
|
|
import Login from "@/views/Login";
|
|
import SignOut from "@/views/SignOut";
|
|
import Index from "@/views/index";
|
|
import ErrorPage from "@/views/error-page";
|
|
import ReservationNewest from "@/views/reservation/Newest";
|
|
import ReservationDetail from "@/views/reservation/Detail";
|
|
import FeedbackIndex from "@/views/feedback/Index";
|
|
import FeedbackDetail from "@/views/feedback/Detail";
|
|
import ReservationPrint from "@/views/reservation/Print";
|
|
|
|
configure({
|
|
useProxies: "ifavailable",
|
|
enforceActions: "always",
|
|
computedRequiresReaction: true,
|
|
reactionRequiresObservable: true,
|
|
observableRequiresReaction: true,
|
|
disableErrorBoundaries: true
|
|
});
|
|
|
|
const router = createBrowserRouter([
|
|
{
|
|
path: "/",
|
|
element: <App />,
|
|
errorElement: <ErrorPage />,
|
|
children: [
|
|
{ index: true, element: <Index /> },
|
|
{ path: "reservation/newest", element: <ReservationNewest />},
|
|
{ path: "reservation/:reservationId", element: <ReservationDetail />},
|
|
{ path: "reservation/:reservationId/print", element: <ReservationPrint />},
|
|
{ path: "feedback", element: <FeedbackIndex />},
|
|
{ path: "feedback/:feedbackId", element: <FeedbackDetail />},
|
|
]
|
|
},
|
|
{
|
|
element: <App />,
|
|
children: [
|
|
{ path: "/login", element: <Login /> },
|
|
{ path: "/sign-out", element: <SignOut /> }
|
|
]
|
|
}
|
|
]);
|
|
|
|
const rootStore = new RootStore();
|
|
|
|
ReactDOM.createRoot(document.getElementById("root")).render(
|
|
//<React.StrictMode>
|
|
<StoreContext.Provider value={rootStore}>
|
|
<RouterProvider
|
|
router={router}
|
|
fallbackElement={() => <div>Loading...</div>}
|
|
/>
|
|
</StoreContext.Provider>
|
|
//</React.StrictMode>
|
|
); |