From 81342e2579165ebfdb28c749dc5225141721a419 Mon Sep 17 00:00:00 2001 From: FifthWit Date: Thu, 30 Jan 2025 13:11:48 -0600 Subject: switched to double quotes --- frontend/src/pages/Maplist.tsx | 64 +++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 'frontend/src/pages/Maplist.tsx') diff --git a/frontend/src/pages/Maplist.tsx b/frontend/src/pages/Maplist.tsx index 372b800..a7242ef 100644 --- a/frontend/src/pages/Maplist.tsx +++ b/frontend/src/pages/Maplist.tsx @@ -1,11 +1,11 @@ -import React, { useEffect } from 'react'; -import { Link, useLocation, useNavigate, useParams } from 'react-router-dom'; -import { Helmet } from 'react-helmet'; +import React, { useEffect } from "react"; +import { Link, useLocation, useNavigate, useParams } from "react-router-dom"; +import { Helmet } from "react-helmet"; -import '@css/Maplist.css'; -import { API } from '@api/Api'; -import { Game } from '@customTypes/Game'; -import { GameChapter, GamesChapters } from '@customTypes/Chapters'; +import "@css/Maplist.css"; +import { API } from "@api/Api"; +import { Game } from "@customTypes/Game"; +import { GameChapter, GamesChapters } from "@customTypes/Chapters"; const Maplist: React.FC = () => { const [game, setGame] = React.useState(null); @@ -18,7 +18,7 @@ const Maplist: React.FC = () => { const [curChapter, setCurChapter] = React.useState(); const [numChapters, setNumChapters] = React.useState(0); - const [dropdownActive, setDropdownActive] = React.useState('none'); + const [dropdownActive, setDropdownActive] = React.useState("none"); const params = useParams<{ id: string; chapter: string }>(); const location = useLocation(); @@ -26,7 +26,7 @@ const Maplist: React.FC = () => { function _update_currently_selected(catNum2: number) { setCurrentlySelected(catNum2); - navigate('/games/' + game?.id + '?cat=' + catNum2); + navigate("/games/" + game?.id + "?cat=" + catNum2); setHasClicked(true); } @@ -36,23 +36,23 @@ const Maplist: React.FC = () => { }; const _handle_dropdown_click = () => { - if (dropdownActive === 'none') { - setDropdownActive('block'); + if (dropdownActive === "none") { + setDropdownActive("block"); } else { - setDropdownActive('none'); + setDropdownActive("none"); } }; // im sorry but im too lazy to fix this right now useEffect(() => { // gameID - const gameId = parseFloat(params.id || ''); + const gameId = parseFloat(params.id || ""); setId(gameId); // location query params const queryParams = new URLSearchParams(location.search); - if (queryParams.get('chapter')) { - let cat = parseFloat(queryParams.get('chapter') || ''); + if (queryParams.get("chapter")) { + let cat = parseFloat(queryParams.get("chapter") || ""); if (gameId === 2) { cat += 10; } @@ -82,7 +82,7 @@ const Maplist: React.FC = () => { useEffect(() => { const queryParams = new URLSearchParams(location.search); - if (gameChapters !== undefined && !queryParams.get('chapter')) { + if (gameChapters !== undefined && !queryParams.get("chapter")) { _fetch_chapters(gameChapters!.chapters[0].id.toString()); } }, [gameChapters, location.search]); @@ -92,9 +92,9 @@ const Maplist: React.FC = () => { LPHUB | Maplist -
+
- @@ -127,8 +127,8 @@ const Maplist: React.FC = () => { className={ currentlySelected === cat.category.id || (cat.category.id - 1 === catNum && !hasClicked) - ? 'game-cat-button selected' - : 'game-cat-button' + ? "game-cat-button selected" + : "game-cat-button" } onClick={() => { setCatNum(cat.category.id - 1); @@ -147,17 +147,17 @@ const Maplist: React.FC = () => {
- {curChapter?.chapter.name.split(' - ')[0]} + {curChapter?.chapter.name.split(" - ")[0]}
- {curChapter?.chapter.name.split(' - ')[1]} + {curChapter?.chapter.name.split(" - ")[1]}
{
-- cgit v1.2.3