Skip to content

Commit

Permalink
fix: hashRouter -> BrowserRouter
Browse files Browse the repository at this point in the history
  • Loading branch information
nxhawk committed Jun 6, 2024
1 parent 82a24bf commit f681ad8
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 75 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ This project was created and is actively maintained by:
- [21120455 Trương Văn Hoài](https://github.com/hcdman)
- [21120457 Lê Minh Hoàng](https://github.com/mihoag)

Detail: https://me-d-c-truy-n.github.io/Frontend/#/thong-tin/nhom-phat-trien
Detail: https://me-d-c-truy-n.github.io/Frontend/thong-tin/nhom-phat-trien
# License

MIT license [@nxhawk](https://github.com/nxhawk/)
153 changes: 79 additions & 74 deletions src/routers/router.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createHashRouter } from "react-router-dom";
import { createBrowserRouter } from "react-router-dom";
import Layout from "../layout/Layout";
import Home from "../pages/Home";
import NovelPreview from "../pages/NovelPreview";
Expand All @@ -14,80 +14,85 @@ import PrivacyPolicy from "../pages/Information/PrivacyPolicy";
import AboutLicense from "../pages/Information/AboutLicense";
import AboutUs from "../pages/Information/AboutUs";

const router = createHashRouter([
const router = createBrowserRouter(
[
{
element: <ScrollToTop />,
children: [
{
element: <Layout />,
children: [
{
path: "/",
element: <Home />,
},
{
path: "/tu-truyen",
element: <Bookcase />,
},
{
path: "/truyen/:novelId",
children: [
{
path: "",
element: <NovelPreview />,
},
{
element: <CheckNewServer />,
children: [
{
path: ":chapterId",
element: <NovelChapter />,
},
],
},
],
},
{
path: "/tac-gia/:authorId",
element: <AuthorPage />,
},
{
path: "/tim-kiem",
element: <FilterPage />,
},
{
path: "/thong-tin",
children: [
{
path: "dieu-khoan-dich-vu",
element: <TermOfService />,
},
{
path: "chinh-sach-bao-mat",
element: <PrivacyPolicy />,
},
{
path: "ve-ban-quyen",
element: <AboutLicense />,
},
{
path: "nhom-phat-trien",
element: <AboutUs />,
},
],
},
],
},
{
path: "/notfound",
element: <Notfound />,
},
{
path: "*",
element: <Notfound />,
},
],
},
],
{
element: <ScrollToTop />,
children: [
{
element: <Layout />,
children: [
{
path: "/",
element: <Home />,
},
{
path: "/tu-truyen",
element: <Bookcase />,
},
{
path: "/truyen/:novelId",
children: [
{
path: "",
element: <NovelPreview />,
},
{
element: <CheckNewServer />,
children: [
{
path: ":chapterId",
element: <NovelChapter />,
},
],
},
],
},
{
path: "/tac-gia/:authorId",
element: <AuthorPage />,
},
{
path: "/tim-kiem",
element: <FilterPage />,
},
{
path: "/thong-tin",
children: [
{
path: "dieu-khoan-dich-vu",
element: <TermOfService />,
},
{
path: "chinh-sach-bao-mat",
element: <PrivacyPolicy />,
},
{
path: "ve-ban-quyen",
element: <AboutLicense />,
},
{
path: "nhom-phat-trien",
element: <AboutUs />,
},
],
},
],
},
{
path: "/notfound",
element: <Notfound />,
},
{
path: "*",
element: <Notfound />,
},
],
basename: "/Frontend",
},
]);
);

export default router;

0 comments on commit f681ad8

Please sign in to comment.