From acb0dc5483a3c7b9d2efec0805fe7f533dcb6147 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Mon, 20 Oct 2025 16:01:47 -0700 Subject: [PATCH] seperate dancerush and dancearound eamuse import modals --- ...musementModal.tsx => DanceAroundModal.tsx} | 37 ++--- .../src/components/modals/DancerushModal.tsx | 155 ++++++++++++++++++ frontend/src/pages/Import.tsx | 32 ++-- 3 files changed, 193 insertions(+), 31 deletions(-) rename frontend/src/components/modals/{EamusementModal.tsx => DanceAroundModal.tsx} (79%) create mode 100644 frontend/src/components/modals/DancerushModal.tsx diff --git a/frontend/src/components/modals/EamusementModal.tsx b/frontend/src/components/modals/DanceAroundModal.tsx similarity index 79% rename from frontend/src/components/modals/EamusementModal.tsx rename to frontend/src/components/modals/DanceAroundModal.tsx index cb5c542..45f1f6f 100644 --- a/frontend/src/components/modals/EamusementModal.tsx +++ b/frontend/src/components/modals/DanceAroundModal.tsx @@ -1,24 +1,19 @@ import type { SupportedGame } from "../../types/game"; import { EamuseImportInfo } from "../../types/constants"; -interface EamusementUploadModalProps { +interface DanceAroundModalProps { isOpen: boolean; onClose: () => void; game: SupportedGame | undefined; renderAsCard?: () => void; } -const scriptLinkMap = { - "dancerush": "https://github.com/pinapelz/Mirage/raw/refs/heads/main/scripts/dancerush/dancerush_play_history.user.js", - "dancearound": "https://github.com/pinapelz/Mirage/raw/refs/heads/main/scripts/dancearound/dancearound_play_history.user.js", -} - -const EamusementUploadModal = ({ +const DanceAroundModal = ({ isOpen, onClose, game, renderAsCard -}: EamusementUploadModalProps) => { +}: DanceAroundModalProps) => { if (renderAsCard) { return (
@@ -38,10 +33,10 @@ const EamusementUploadModal = ({

- e-amusement Play History + Dance aROUND e-amusement Play History

- Import via scraping your playdata from KONAMI e-amusement + Import via scraping your Dance aROUND playdata from KONAMI e-amusement

+ + ); + } + + if (!isOpen) return null; + + const handleClose = () => { + onClose(); + }; + if(game === undefined){ + return "Sorry, due to some extreme error the game you're looking for doesn't seem to exist..." + } + return ( +
+ {/* Backdrop */} +
+ + {/* Modal */} +
+
+ {/* Header */} +
+

+ Import DANCERUSH Data +

+

+ Follow the instructions below to import your data +

+
+ + {/* Warning */} +
+

+ You may or may need to be subscribed to{" "} + + KONAMI's e-amusement Basic and/or Premium course + {" "} + to view a exportable playdata history for certain games. +

+
+ + {/* Instructions */} +
+

+ Instructions: +

+
    +
  1. Log into your e-amusement account
  2. + {EamuseImportInfo["dancerush"] ? ( +
  3. + Navigate to your{" "} + + DANCERUSH score data page + {" "} + DANCERUSH score data page +
  4. + ) : ( +
  5. Navigate to your DANCERUSH score data page
  6. + )} + {EamuseImportInfo["dancerush"] ? ( +
  7. + Install the userscript to your browser (use an extension such + as Tampermonkey) +
  8. + ) : ( +
  9. + Scrape the data using any method of your choice and translate + it into a Mirage DANCERUSH compatible JSON format +
  10. + )} +
  11. Upload the resulting JSON file into Mirage using the Batch-Manual Upload functionality
  12. +
  13. Verify that all data has been imported correctly
  14. +
+
+ + {/* Additional Info */} + + + {/* Actions */} +
+ +
+
+
+
+ ); +}; + +export default DancerushModal; diff --git a/frontend/src/pages/Import.tsx b/frontend/src/pages/Import.tsx index b2e531b..0de1b2d 100644 --- a/frontend/src/pages/Import.tsx +++ b/frontend/src/pages/Import.tsx @@ -7,7 +7,8 @@ import { uploadScore } from "../utils/scoreUpload"; import { NavBar } from "../components/NavBar"; const JsonUploadModal = lazy(() => import("../components/modals/JsonUploadModal")); -const EamusementModal = lazy(() => import("../components/modals/EamusementModal")); +const DancerushModal = lazy(() => import("../components/modals/DancerushModal")); +const DanceAroundModal = lazy(() => import("../components/modals/DanceAroundModal")); const DivaNetModal = lazy(() => import("../components/modals/DivaNetModal")); const Import = () => { @@ -15,7 +16,8 @@ const Import = () => { const navigate = useNavigate(); const [selectedGame, setSelectedGame] = useState(""); const [isJsonModalOpen, setIsJsonModalOpen] = useState(false); - const [isEamusementModalOpen, setIsEamusementModalOpen] = useState(false); + const [isDancerushModalOpen, setIsDancerushModalOpen] = useState(false); + const [isDanceAroundModalOpen, setIsDanceAroundModalOpen] = useState(false); const [isDivaNetModalOpen, setIsDivaNetModalOpen] = useState(false); const [supportedGames, setSupportedGames] = useState([]); const [gamesLoading, setGamesLoading] = useState(true); @@ -132,11 +134,11 @@ const Import = () => { return ( <> - {}} game={supportedGames.find((g) => g.internalName === selectedGame)} - renderAsCard={() => setIsEamusementModalOpen(true)} + renderAsCard={() => setIsDancerushModalOpen(true)} /> ); @@ -145,11 +147,11 @@ const Import = () => { return ( <> - {}} game={supportedGames.find((g) => g.internalName === selectedGame)} - renderAsCard={() => setIsEamusementModalOpen(true)} + renderAsCard={() => setIsDanceAroundModalOpen(true)} /> ); @@ -286,10 +288,20 @@ const Import = () => { } /> )} - {isEamusementModalOpen && ( - setIsEamusementModalOpen(false)} + {isDancerushModalOpen && ( + setIsDancerushModalOpen(false)} + game={ + supportedGames.find((g) => g.internalName === selectedGame) || + undefined + } + /> + )} + {isDanceAroundModalOpen && ( + setIsDanceAroundModalOpen(false)} game={ supportedGames.find((g) => g.internalName === selectedGame) || undefined