From ccd08bc0f03cb59b351c19d78ac0f937a5270368 Mon Sep 17 00:00:00 2001 From: Wolfboy248 Date: Mon, 25 Aug 2025 11:13:20 +0200 Subject: Moved breadcrum navigation into its own component --- frontend/src/pages/Maplist/Maplist.tsx | 14 +-- frontend/src/pages/Maps/Maps.tsx | 150 +++++++++++++-------------------- frontend/src/pages/Rules/Rules.tsx | 4 +- 3 files changed, 65 insertions(+), 103 deletions(-) (limited to 'frontend/src/pages') diff --git a/frontend/src/pages/Maplist/Maplist.tsx b/frontend/src/pages/Maplist/Maplist.tsx index a5649db..d8acdf0 100644 --- a/frontend/src/pages/Maplist/Maplist.tsx +++ b/frontend/src/pages/Maplist/Maplist.tsx @@ -7,6 +7,7 @@ import { Game } from "@customTypes/Game.ts"; import { GameChapter, GamesChapters } from "@customTypes/Chapters.ts"; import Map from "./Components/Map"; +import BreadcrumbNav from "@components/BreadcrumbNav/BreadcrumbNav"; const Maplist: React.FC = () => { const [game, setGame] = React.useState(null); @@ -89,24 +90,17 @@ const Maplist: React.FC = () => { }, [gameChapters, location.search]); return ( -
+
LPHUB | Maplist -
- - - -
+ {load ? (
) : ( -
+

{game?.name}

diff --git a/frontend/src/pages/Maps/Maps.tsx b/frontend/src/pages/Maps/Maps.tsx index 75e3635..03de289 100644 --- a/frontend/src/pages/Maps/Maps.tsx +++ b/frontend/src/pages/Maps/Maps.tsx @@ -9,6 +9,7 @@ import Discussions from "@components/Discussions.tsx"; import ModMenu from "@components/ModMenu.tsx"; import { MapDiscussions, MapLeaderboard, MapSummary } from "@customTypes/Map.ts"; import { API } from "@api/Api.ts"; +import BreadcrumbNav from "@components/BreadcrumbNav/BreadcrumbNav.tsx"; interface MapProps { token?: string; @@ -64,37 +65,28 @@ const Maps: React.FC = ({ token, isModerator }) => { // loading placeholder return ( <> -
-
-
- - - -
-
- -
- - - -
+
+ + +
+
+ + + +
-
-
+
+
+
); } @@ -117,67 +109,43 @@ const Maps: React.FC = ({ token, isModerator }) => {
-
-
-
- - - - - - -
- - {mapSummaryData.map.map_name} - -
-
- -
- - - -
- - {navState === 0 && ( - - )} - {navState === 1 && } - {navState === 2 && ( - _fetch_map_discussions()} - /> - )} -
+
+ +
+
+ + + +
+ + {navState === 0 && ( + + )} + {navState === 1 && } + {navState === 2 && ( + _fetch_map_discussions()} + /> + )} +
+
); }; diff --git a/frontend/src/pages/Rules/Rules.tsx b/frontend/src/pages/Rules/Rules.tsx index 9c7885c..20d301c 100644 --- a/frontend/src/pages/Rules/Rules.tsx +++ b/frontend/src/pages/Rules/Rules.tsx @@ -25,12 +25,12 @@ const Rules: React.FC = () => { }, []); return ( -
+
LPHUB | Rules {rulesText} -
+ ); }; -- cgit v1.2.3