mirror of
https://github.com/lemeow125/Ivy-Frontend.git
synced 2024-11-17 06:39:25 +08:00
Switch to hashrouter for github pages compatibility
This commit is contained in:
parent
db817e3be1
commit
8af4b9b3ac
1 changed files with 87 additions and 80 deletions
167
src/App.tsx
167
src/App.tsx
|
@ -4,7 +4,11 @@ import Error from "./Routes/Error/Error";
|
||||||
import Products from "./Routes/Products/Products";
|
import Products from "./Routes/Products/Products";
|
||||||
import Logs from "./Routes/Logs/Logs";
|
import Logs from "./Routes/Logs/Logs";
|
||||||
import Container from "./Components/Container/Container";
|
import Container from "./Components/Container/Container";
|
||||||
import { createBrowserRouter, RouterProvider } from "react-router-dom";
|
import {
|
||||||
|
createBrowserRouter,
|
||||||
|
createHashRouter,
|
||||||
|
RouterProvider,
|
||||||
|
} from "react-router-dom";
|
||||||
import Store from "./Plugins/Redux/Store/Store";
|
import Store from "./Plugins/Redux/Store/Store";
|
||||||
import { Provider } from "react-redux";
|
import { Provider } from "react-redux";
|
||||||
import Inventory from "./Routes/Inventory/Inventory";
|
import Inventory from "./Routes/Inventory/Inventory";
|
||||||
|
@ -17,85 +21,88 @@ import Register from "./Routes/Register/Register";
|
||||||
|
|
||||||
const queryClient = new QueryClient();
|
const queryClient = new QueryClient();
|
||||||
|
|
||||||
const router = createBrowserRouter([
|
const router = createHashRouter(
|
||||||
{
|
[
|
||||||
path: "/",
|
{
|
||||||
element: (
|
path: "/",
|
||||||
<Container>
|
element: (
|
||||||
<Dashboard />
|
<Container>
|
||||||
</Container>
|
<Dashboard />
|
||||||
),
|
</Container>
|
||||||
errorElement: (
|
),
|
||||||
<Container>
|
errorElement: (
|
||||||
<Error />
|
<Container>
|
||||||
</Container>
|
<Error />
|
||||||
),
|
</Container>
|
||||||
},
|
),
|
||||||
{
|
},
|
||||||
path: "/Products",
|
{
|
||||||
element: (
|
path: "/Products",
|
||||||
<Container>
|
element: (
|
||||||
<Products />
|
<Container>
|
||||||
</Container>
|
<Products />
|
||||||
),
|
</Container>
|
||||||
},
|
),
|
||||||
{
|
},
|
||||||
path: "/Inventory",
|
{
|
||||||
element: (
|
path: "/Inventory",
|
||||||
<Container>
|
element: (
|
||||||
<Inventory />
|
<Container>
|
||||||
</Container>
|
<Inventory />
|
||||||
),
|
</Container>
|
||||||
},
|
),
|
||||||
{
|
},
|
||||||
path: "/Logs",
|
{
|
||||||
element: (
|
path: "/Logs",
|
||||||
<Container>
|
element: (
|
||||||
<Logs />
|
<Container>
|
||||||
</Container>
|
<Logs />
|
||||||
),
|
</Container>
|
||||||
},
|
),
|
||||||
{
|
},
|
||||||
path: "/Login",
|
{
|
||||||
element: (
|
path: "/Login",
|
||||||
<Container>
|
element: (
|
||||||
<Login />
|
<Container>
|
||||||
</Container>
|
<Login />
|
||||||
),
|
</Container>
|
||||||
},
|
),
|
||||||
{
|
},
|
||||||
path: "/Product/:id",
|
{
|
||||||
element: (
|
path: "/Product/:id",
|
||||||
<Container>
|
element: (
|
||||||
<Product />
|
<Container>
|
||||||
</Container>
|
<Product />
|
||||||
),
|
</Container>
|
||||||
},
|
),
|
||||||
{
|
},
|
||||||
path: "/Activation/:uid/:token",
|
{
|
||||||
element: (
|
path: "/Activation/:uid/:token",
|
||||||
<Container>
|
element: (
|
||||||
<Activation />
|
<Container>
|
||||||
</Container>
|
<Activation />
|
||||||
),
|
</Container>
|
||||||
},
|
),
|
||||||
{
|
},
|
||||||
path: "/NewProduct",
|
{
|
||||||
element: (
|
path: "/NewProduct",
|
||||||
<Container>
|
element: (
|
||||||
<NewProduct />
|
<Container>
|
||||||
</Container>
|
<NewProduct />
|
||||||
),
|
</Container>
|
||||||
},
|
),
|
||||||
{
|
},
|
||||||
path: "/Register",
|
{
|
||||||
element: (
|
path: "/Register",
|
||||||
<Container>
|
element: (
|
||||||
<Register />
|
<Container>
|
||||||
</Container>
|
<Register />
|
||||||
),
|
</Container>
|
||||||
},
|
),
|
||||||
]);
|
},
|
||||||
|
],
|
||||||
|
{ basename: "/Ivy" }
|
||||||
|
);
|
||||||
|
|
||||||
export default function App() {
|
export default function App() {
|
||||||
return (
|
return (
|
||||||
|
|
Loading…
Reference in a new issue