From f681ad8b1217aca8ffaab2ab33ff1bb80a8f5569 Mon Sep 17 00:00:00 2001 From: 21120447 Date: Thu, 6 Jun 2024 14:34:16 +0700 Subject: [PATCH] fix: hashRouter -> BrowserRouter --- README.md | 2 +- src/routers/router.tsx | 153 +++++++++++++++++++++-------------------- 2 files changed, 80 insertions(+), 75 deletions(-) diff --git a/README.md b/README.md index a92ac26..1f5423a 100644 --- a/README.md +++ b/README.md @@ -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/) diff --git a/src/routers/router.tsx b/src/routers/router.tsx index 9af0bad..3e2c39b 100644 --- a/src/routers/router.tsx +++ b/src/routers/router.tsx @@ -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"; @@ -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: , + children: [ + { + element: , + children: [ + { + path: "/", + element: , + }, + { + path: "/tu-truyen", + element: , + }, + { + path: "/truyen/:novelId", + children: [ + { + path: "", + element: , + }, + { + element: , + children: [ + { + path: ":chapterId", + element: , + }, + ], + }, + ], + }, + { + path: "/tac-gia/:authorId", + element: , + }, + { + path: "/tim-kiem", + element: , + }, + { + path: "/thong-tin", + children: [ + { + path: "dieu-khoan-dich-vu", + element: , + }, + { + path: "chinh-sach-bao-mat", + element: , + }, + { + path: "ve-ban-quyen", + element: , + }, + { + path: "nhom-phat-trien", + element: , + }, + ], + }, + ], + }, + { + path: "/notfound", + element: , + }, + { + path: "*", + element: , + }, + ], + }, + ], { - element: , - children: [ - { - element: , - children: [ - { - path: "/", - element: , - }, - { - path: "/tu-truyen", - element: , - }, - { - path: "/truyen/:novelId", - children: [ - { - path: "", - element: , - }, - { - element: , - children: [ - { - path: ":chapterId", - element: , - }, - ], - }, - ], - }, - { - path: "/tac-gia/:authorId", - element: , - }, - { - path: "/tim-kiem", - element: , - }, - { - path: "/thong-tin", - children: [ - { - path: "dieu-khoan-dich-vu", - element: , - }, - { - path: "chinh-sach-bao-mat", - element: , - }, - { - path: "ve-ban-quyen", - element: , - }, - { - path: "nhom-phat-trien", - element: , - }, - ], - }, - ], - }, - { - path: "/notfound", - element: , - }, - { - path: "*", - element: , - }, - ], + basename: "/Frontend", }, -]); +); export default router;