2023-11-13 22:19:33 +08:00
|
|
|
import LandingPage from "./Pages/LandingPage/LandingPage";
|
|
|
|
import { createHashRouter, RouterProvider } from "react-router-dom";
|
|
|
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
|
|
import { Provider } from "react-redux";
|
|
|
|
import "./App.css";
|
|
|
|
import store from "./Components/Plugins/Redux/Store/Store";
|
2023-11-13 22:46:14 +08:00
|
|
|
import { ToastContainer } from "react-toastify";
|
|
|
|
import "react-toastify/dist/ReactToastify.css";
|
2023-11-17 17:16:43 +08:00
|
|
|
import ErrorPage from "./Pages/ErrorPage/ErrorPage";
|
|
|
|
import DashboardPage from "./Pages/DashboardPage/DashboardPage";
|
2023-11-19 16:46:04 +08:00
|
|
|
import Revalidator from "./Components/Revalidator/Revalidator";
|
2023-11-19 23:11:27 +08:00
|
|
|
import ActivationPage from "./Pages/ActivationPage/ActivationPage";
|
2023-11-17 17:16:43 +08:00
|
|
|
|
|
|
|
const queryClient = new QueryClient();
|
2023-11-13 22:19:33 +08:00
|
|
|
const router = createHashRouter([
|
|
|
|
{
|
|
|
|
path: "/",
|
2023-11-19 16:46:04 +08:00
|
|
|
element: (
|
|
|
|
<>
|
|
|
|
<Revalidator />
|
|
|
|
<LandingPage />
|
|
|
|
</>
|
|
|
|
),
|
2023-11-17 17:16:43 +08:00
|
|
|
errorElement: <ErrorPage />,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/dashboard",
|
2023-11-19 16:46:04 +08:00
|
|
|
element: (
|
|
|
|
<>
|
|
|
|
<Revalidator />
|
|
|
|
<DashboardPage />
|
|
|
|
</>
|
|
|
|
),
|
2023-11-17 17:16:43 +08:00
|
|
|
errorElement: <ErrorPage />,
|
2023-11-13 22:19:33 +08:00
|
|
|
},
|
2023-11-19 23:11:27 +08:00
|
|
|
{
|
|
|
|
path: "/activation/:uid/:token",
|
|
|
|
element: (
|
|
|
|
<>
|
|
|
|
<ActivationPage />
|
|
|
|
</>
|
|
|
|
),
|
|
|
|
errorElement: <ErrorPage />,
|
|
|
|
},
|
2023-11-13 22:19:33 +08:00
|
|
|
]);
|
|
|
|
|
|
|
|
export default function App() {
|
2023-10-22 00:36:53 +08:00
|
|
|
return (
|
2023-11-13 22:19:33 +08:00
|
|
|
<Provider store={store}>
|
|
|
|
<QueryClientProvider client={queryClient}>
|
|
|
|
<RouterProvider router={router} />
|
|
|
|
</QueryClientProvider>
|
2023-11-13 22:46:14 +08:00
|
|
|
<ToastContainer
|
2023-11-19 14:50:39 +08:00
|
|
|
position={"top-right"}
|
2023-11-13 22:46:14 +08:00
|
|
|
autoClose={1500}
|
|
|
|
closeOnClick
|
|
|
|
pauseOnHover
|
|
|
|
draggable
|
|
|
|
theme={"light"}
|
|
|
|
limit={3}
|
|
|
|
/>
|
2023-11-13 22:19:33 +08:00
|
|
|
</Provider>
|
|
|
|
);
|
2023-10-22 00:36:53 +08:00
|
|
|
}
|