Skip to content

Commit 1afb503

Browse files
committed
BrowserRouter to HashRouter
1 parent 6286bb1 commit 1afb503

File tree

1 file changed

+18
-25
lines changed

1 file changed

+18
-25
lines changed

src/routes.tsx

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createBrowserRouter } from 'react-router-dom';
1+
import { createHashRouter } from 'react-router-dom';
22
import MainPage from './pages/MainPage';
33
import AboutUs from './pages/About/AboutUs';
44
import Mission from './pages/About/Mission';
@@ -15,29 +15,22 @@ import Volunteer from './pages/Volunteer';
1515
import Donate from './pages/Donate';
1616
import Products from './pages/Products';
1717

18-
const BASE_PATH = '/www-v2';
19-
20-
const router = createBrowserRouter(
21-
[
22-
{ path: `/`, element: <MainPage /> },
23-
{ path: `/about-us`, element: <AboutUs /> },
24-
{ path: `/mission`, element: <Mission /> },
25-
{ path: `/leadership`, element: <Leadership /> },
26-
{ path: `/contact-us`, element: <ContactUs /> },
27-
{ path: `/faqs`, element: <FAQs /> },
28-
{ path: `/community-news`, element: <CommunityNews /> },
29-
{ path: `/events`, element: <Events /> },
30-
{ path: `/press-release`, element: <PressRelease /> },
31-
{ path: `/sugar-stories`, element: <SugarStories /> },
32-
{ path: `/try-sugar`, element: <TrySugar /> },
33-
{ path: `/join-development`, element: <JoinDevelopment /> },
34-
{ path: `/volunteer`, element: <Volunteer /> },
35-
{ path: `/donate`, element: <Donate /> },
36-
{ path: `/products`, element: <Products /> },
37-
],
38-
{
39-
basename: BASE_PATH, // Set the basename to match the repository name
40-
},
41-
);
18+
const router = createHashRouter([
19+
{ path: `/`, element: <MainPage /> },
20+
{ path: `/about-us`, element: <AboutUs /> },
21+
{ path: `/mission`, element: <Mission /> },
22+
{ path: `/leadership`, element: <Leadership /> },
23+
{ path: `/contact-us`, element: <ContactUs /> },
24+
{ path: `/faqs`, element: <FAQs /> },
25+
{ path: `/community-news`, element: <CommunityNews /> },
26+
{ path: `/events`, element: <Events /> },
27+
{ path: `/press-release`, element: <PressRelease /> },
28+
{ path: `/sugar-stories`, element: <SugarStories /> },
29+
{ path: `/try-sugar`, element: <TrySugar /> },
30+
{ path: `/join-development`, element: <JoinDevelopment /> },
31+
{ path: `/volunteer`, element: <Volunteer /> },
32+
{ path: `/donate`, element: <Donate /> },
33+
{ path: `/products`, element: <Products /> },
34+
]);
4235

4336
export default router;

0 commit comments

Comments
 (0)