From 445d5c14eff9beb62f2a20ac5234fbdf40c3c890 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Mon, 19 May 2025 16:31:57 -0700 Subject: frontend: add WMMT, add new section for non-rhythm --- site/src/components/GameNotes.tsx | 5 +++ site/src/components/TitleBar.tsx | 80 +++++++++++++++++++++++++++++++++++++-- site/src/utils.ts | 6 ++- 3 files changed, 86 insertions(+), 5 deletions(-) (limited to 'site/src') diff --git a/site/src/components/GameNotes.tsx b/site/src/components/GameNotes.tsx index 0e5504a..82f1629 100644 --- a/site/src/components/GameNotes.tsx +++ b/site/src/components/GameNotes.tsx @@ -392,6 +392,11 @@ export const GameNotes = (isMoe: boolean): Record => ({ > Needs to be sideloaded once you get a hold of the IPA. Network features supported. iOS ONLY

+

+ *Not in main feed as date data is unavailable from this source +

) }); diff --git a/site/src/components/TitleBar.tsx b/site/src/components/TitleBar.tsx index ce70aaa..8016a77 100644 --- a/site/src/components/TitleBar.tsx +++ b/site/src/components/TitleBar.tsx @@ -12,7 +12,9 @@ interface GameCategory { } const TitleBar: React.FC = () => { const [dropdownOpen, setDropdownOpen] = useState(false); + const [otherDropdownOpen, setOtherDropdownOpen] = useState(false); const dropdownRef = useRef(null); + const otherDropdownRef = useRef(null); const [searchParams] = useSearchParams(); const navigate = useNavigate(); const location = useLocation(); @@ -95,6 +97,15 @@ const TitleBar: React.FC = () => { }, ]; + const otherGames: GameCategory[] = [ + { + name: "BANDAI NAMCO", + games: [ + { id: "wmmt", title: "WANGAN MAXI" }, + ], + }, + ]; + useEffect(() => { const handleClickOutside = (event: MouseEvent) => { if ( @@ -103,11 +114,18 @@ const TitleBar: React.FC = () => { ) { setDropdownOpen(false); } + if ( + otherDropdownRef.current && + !otherDropdownRef.current.contains(event.target as Node) + ) { + setOtherDropdownOpen(false); + } }; - if (dropdownOpen) + if (dropdownOpen || otherDropdownOpen) document.addEventListener("mousedown", handleClickOutside); - return () => document.removeEventListener("mousedown", handleClickOutside); - }, [dropdownOpen]); + return () => + document.removeEventListener("mousedown", handleClickOutside); + }, [dropdownOpen, otherDropdownOpen]); return (
{ className={`${isMoe ? "text-pink-800 hover:text-pink-600" : "text-gray-300 hover:text-white"} font-medium flex items-center`} onClick={() => setDropdownOpen(!dropdownOpen)} > - Game Select + Rhythm Games {
)} + +
+ + + {otherDropdownOpen && ( +
+
+ {otherGames.map((category, index) => ( +
+
+ {category.name} +
+
3 ? "grid grid-cols-1 sm:grid-cols-2 gap-x-2 gap-y-0.5" : "space-y-0.5"}`} + > + {category.games.map((game) => ( + setOtherDropdownOpen(false)} + > + {game.title} + + ))} +
+
+ ))} +
+
+ )} +
diff --git a/site/src/utils.ts b/site/src/utils.ts index c6f4ba6..47652da 100644 --- a/site/src/utils.ts +++ b/site/src/utils.ts @@ -22,7 +22,11 @@ export const getGameTitle = (gameId: string) => { if (lowerCaseGameId.startsWith("reflec_beat") || lowerCaseGameId.startsWith("rb_deluxe")) return "REFLEC BEAT DELUXE PLUS"; if (lowerCaseGameId.startsWith("dance_rush")) return "DANCERUSH"; if(lowerCaseGameId.startsWith("dance_around")) return "DANCE aROUND"; - if(lowerCaseGameId.startsWith("polaris_chord")) return "POLARIS CHORD/ポラリスコード" + if(lowerCaseGameId.startsWith("polaris_chord")) return "POLARIS CHORD/ポラリスコード"; + if(lowerCaseGameId.startsWith("wmmt")) return "WANGAN MIDNIGHT MAXIMUM TUNE"; + if(lowerCaseGameId.startsWith("wangan_maxi_jp")) return "WANGAN MIDNIGHT MAXIMUM TUNE (JAPAN)"; + if(lowerCaseGameId.startsWith("wangan_maxi_na")) return "WANGAN MIDNIGHT MAXIMUM TUNE (NORTH AMERICA)"; + if(lowerCaseGameId.startsWith("wangan_maxi_asia_oce")) return "WANGAN MIDNIGHT MAXIMUM TUNE (ASIA/OCEANIA)"; return gameId.toUpperCase(); -- cgit v1.2.3