diff options
| author | Wolfboy248 <georgejvindkarlsen@gmail.com> | 2025-08-26 08:20:51 +0200 |
|---|---|---|
| committer | Wolfboy248 <georgejvindkarlsen@gmail.com> | 2025-08-26 08:20:51 +0200 |
| commit | ddfe5015c9237fbe0fea44f8bcde31708eb3adac (patch) | |
| tree | db7d9812461c0ab0dc39812465f20bc958f9bf67 /frontend/src/pages/Maps | |
| parent | Moved breadcrum navigation into its own component (diff) | |
| download | lphub-ddfe5015c9237fbe0fea44f8bcde31708eb3adac.tar.gz lphub-ddfe5015c9237fbe0fea44f8bcde31708eb3adac.tar.bz2 lphub-ddfe5015c9237fbe0fea44f8bcde31708eb3adac.zip | |
Fixed some inconsistant styles and fixed category queryparam in maplist pagecss
Diffstat (limited to '')
| -rw-r--r-- | frontend/src/pages/Maps/Maps.module.css | 22 | ||||
| -rw-r--r-- | frontend/src/pages/Maps/Maps.tsx | 23 |
2 files changed, 37 insertions, 8 deletions
diff --git a/frontend/src/pages/Maps/Maps.module.css b/frontend/src/pages/Maps/Maps.module.css new file mode 100644 index 0000000..5c2b414 --- /dev/null +++ b/frontend/src/pages/Maps/Maps.module.css | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | .button-nav { | ||
| 2 | display: flex; | ||
| 3 | flex: 1; | ||
| 4 | gap: 12px; | ||
| 5 | |||
| 6 | align-items: center; | ||
| 7 | justify-content: center; | ||
| 8 | cursor: pointer; | ||
| 9 | |||
| 10 | background-color: var(--color-block); | ||
| 11 | transition: all 0.1s ease; | ||
| 12 | padding: 8px 0px; | ||
| 13 | font-size: 28px; | ||
| 14 | } | ||
| 15 | |||
| 16 | .button-nav:hover { | ||
| 17 | background-color: var(--color-panel); | ||
| 18 | } | ||
| 19 | |||
| 20 | .button-nav>span { | ||
| 21 | transform: translateY(-2px); | ||
| 22 | } \ No newline at end of file | ||
diff --git a/frontend/src/pages/Maps/Maps.tsx b/frontend/src/pages/Maps/Maps.tsx index 03de289..3989b56 100644 --- a/frontend/src/pages/Maps/Maps.tsx +++ b/frontend/src/pages/Maps/Maps.tsx | |||
| @@ -2,6 +2,8 @@ import React from "react"; | |||
| 2 | import { Link, useLocation } from "react-router-dom"; | 2 | import { Link, useLocation } from "react-router-dom"; |
| 3 | import { Helmet } from "react-helmet"; | 3 | import { Helmet } from "react-helmet"; |
| 4 | 4 | ||
| 5 | import styles from "./Maps.module.css"; | ||
| 6 | |||
| 5 | import { PortalIcon, FlagIcon, ChatIcon } from "../../images/Images.tsx"; | 7 | import { PortalIcon, FlagIcon, ChatIcon } from "../../images/Images.tsx"; |
| 6 | import Summary from "@components/Summary.tsx"; | 8 | import Summary from "@components/Summary.tsx"; |
| 7 | import Leaderboards from "@components/Leaderboards.tsx"; | 9 | import Leaderboards from "@components/Leaderboards.tsx"; |
| @@ -63,22 +65,25 @@ const Maps: React.FC<MapProps> = ({ token, isModerator }) => { | |||
| 63 | 65 | ||
| 64 | if (!mapSummaryData) { | 66 | if (!mapSummaryData) { |
| 65 | // loading placeholder | 67 | // loading placeholder |
| 68 | // TODO: Don't do this | ||
| 66 | return ( | 69 | return ( |
| 67 | <> | 70 | <> |
| 68 | <div className=""> | 71 | <div className=""> |
| 69 | <BreadcrumbNav /> | 72 | <BreadcrumbNav /> |
| 70 | 73 | ||
| 71 | <div className="px-12"> | 74 | <div className="px-12"> |
| 75 | <h1>Loading...</h1> | ||
| 76 | |||
| 72 | <section id="section2" className="summary1 mt-4 flex gap-2 flex-wrap"> | 77 | <section id="section2" className="summary1 mt-4 flex gap-2 flex-wrap"> |
| 73 | <button className="nav-button"> | 78 | <button className={styles["button-nav"]}> |
| 74 | <img src={PortalIcon} alt="" className="w-5 h-5 sm:w-6 sm:h-6" /> | 79 | <img src={PortalIcon} alt="" className="w-5 h-5 sm:w-6 sm:h-6" /> |
| 75 | <span>Summary</span> | 80 | <span>Summary</span> |
| 76 | </button> | 81 | </button> |
| 77 | <button className="nav-button"> | 82 | <button className={styles["button-nav"]}> |
| 78 | <img src={FlagIcon} alt="" className="w-5 h-5 sm:w-6 sm:h-6" /> | 83 | <img src={FlagIcon} alt="" className="w-5 h-5 sm:w-6 sm:h-6" /> |
| 79 | <span>Leaderboards</span> | 84 | <span>Leaderboards</span> |
| 80 | </button> | 85 | </button> |
| 81 | <button className="nav-button"> | 86 | <button className={styles["button-nav"]}> |
| 82 | <img src={ChatIcon} alt="" className="w-5 h-5 sm:w-6 sm:h-6" /> | 87 | <img src={ChatIcon} alt="" className="w-5 h-5 sm:w-6 sm:h-6" /> |
| 83 | <span>Discussions</span> | 88 | <span>Discussions</span> |
| 84 | </button> | 89 | </button> |
| @@ -109,19 +114,21 @@ const Maps: React.FC<MapProps> = ({ token, isModerator }) => { | |||
| 109 | <div id="background-image"> | 114 | <div id="background-image"> |
| 110 | <img src={mapSummaryData.map.image} alt="" /> | 115 | <img src={mapSummaryData.map.image} alt="" /> |
| 111 | </div> | 116 | </div> |
| 112 | <div className=""> | 117 | <div> |
| 113 | <BreadcrumbNav chapter={{ label: mapSummaryData.map.chapter_name, to: `/games/${mapSummaryData.map.is_coop ? "2" : "1"}?chapter=${mapSummaryData.map.chapter_name.split(" ")[1]}` }} /> | 118 | <BreadcrumbNav chapter={{ label: mapSummaryData.map.chapter_name, to: `/games/${mapSummaryData.map.is_coop ? "2" : "1"}?chapter=${mapSummaryData.map.chapter_name.split(" ")[1]}` }} /> |
| 114 | <div className="px-12"> | 119 | <div className="px-12"> |
| 115 | <section id="section2" className="summary1 mt-4 flex gap-2 flex-wrap"> | 120 | <h1>{mapSummaryData.map.map_name}</h1> |
| 116 | <button className="nav-button" onClick={() => setNavState(0)}> | 121 | |
| 122 | <section className="mt-2 flex w-full gap-[2px] rounded-[2000px] overflow-clip"> | ||
| 123 | <button className={styles["button-nav"]} onClick={() => setNavState(0)}> | ||
| 117 | <img src={PortalIcon} alt="" className="w-5 h-5 sm:w-6 sm:h-6" /> | 124 | <img src={PortalIcon} alt="" className="w-5 h-5 sm:w-6 sm:h-6" /> |
| 118 | <span>Summary</span> | 125 | <span>Summary</span> |
| 119 | </button> | 126 | </button> |
| 120 | <button className="nav-button" onClick={() => setNavState(1)}> | 127 | <button className={styles["button-nav"]} onClick={() => setNavState(1)}> |
| 121 | <img src={FlagIcon} alt="" className="w-5 h-5 sm:w-6 sm:h-6" /> | 128 | <img src={FlagIcon} alt="" className="w-5 h-5 sm:w-6 sm:h-6" /> |
| 122 | <span>Leaderboards</span> | 129 | <span>Leaderboards</span> |
| 123 | </button> | 130 | </button> |
| 124 | <button className="nav-button" onClick={() => setNavState(2)}> | 131 | <button className={styles["button-nav"]} onClick={() => setNavState(2)}> |
| 125 | <img src={ChatIcon} alt="" className="w-5 h-5 sm:w-6 sm:h-6" /> | 132 | <img src={ChatIcon} alt="" className="w-5 h-5 sm:w-6 sm:h-6" /> |
| 126 | <span>Discussions</span> | 133 | <span>Discussions</span> |
| 127 | </button> | 134 | </button> |