diff options
| author | Pinapelz <yukais@pinapelz.com> | 2025-10-26 14:47:50 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2025-10-26 14:47:50 -0700 |
| commit | babaaa631d8c3a46be3b9fe23e643b971333937b (patch) | |
| tree | 43b1f0c17af27b2a368b8ffbd8752d6ef52f5295 /frontend/src/pages/Import.tsx | |
| parent | 806743b76b936ce2a8e442a62407ecd64bdc4fa1 (diff) | |
generalize eamusement userscript method into 1 template modal
Diffstat (limited to 'frontend/src/pages/Import.tsx')
| -rw-r--r-- | frontend/src/pages/Import.tsx | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/frontend/src/pages/Import.tsx b/frontend/src/pages/Import.tsx index c72f597..f798b51 100644 --- a/frontend/src/pages/Import.tsx +++ b/frontend/src/pages/Import.tsx @@ -5,10 +5,10 @@ import SessionExpiredPopup from "../components/SessionExpiredPopup"; import type { SupportedGame } from "../types/game"; import { uploadScore } from "../utils/scoreUpload"; import { NavBar } from "../components/NavBar"; +import { EamusementUserscriptCard } from "../components/modals/EamusementUserscriptModal"; const JsonUploadModal = lazy(() => import("../components/modals/JsonUploadModal")); -const DancerushModal = lazy(() => import("../components/modals/DancerushModal")); -const DanceAroundModal = lazy(() => import("../components/modals/DanceAroundModal")); +const EamusementUserscriptModal = lazy(() => import("../components/modals/EamusementUserscriptModal")); const DivaNetModal = lazy(() => import("../components/modals/DivaNetModal")); const MusicDiverModal = lazy(() => import("../components/modals/MusicDiverModal")); @@ -128,19 +128,15 @@ const Import = () => { </div> ); - // Component removed - moved to EamusementModal.tsx - const renderImportOptions = () => { switch (selectedGame) { case "dancerush": return ( <> <JsonUploadCard /> - <DancerushModal - isOpen={false} - onClose={() => {}} - game={supportedGames.find((g) => g.internalName === selectedGame)} - renderAsCard={() => setIsDancerushModalOpen(true)} + <EamusementUserscriptCard + mainGameName="DANCERUSH" + onClick={() => setIsDancerushModalOpen(true)} /> </> ); @@ -148,11 +144,9 @@ const Import = () => { return ( <> <JsonUploadCard /> - <DanceAroundModal - isOpen={false} - onClose={() => {}} - game={supportedGames.find((g) => g.internalName === selectedGame)} - renderAsCard={() => setIsDanceAroundModalOpen(true)} + <EamusementUserscriptCard + mainGameName="DANCE aROUND" + onClick={() => setIsDanceAroundModalOpen(true)} /> </> ); @@ -300,23 +294,29 @@ const Import = () => { /> )} {isDancerushModalOpen && ( - <DancerushModal + <EamusementUserscriptModal isOpen={isDancerushModalOpen} onClose={() => setIsDancerushModalOpen(false)} - game={ - supportedGames.find((g) => g.internalName === selectedGame) || - undefined - } + mainGameName="DANCERUSH" + userPage="https://p.eagate.573.jp/game/dan/1st/top/entrance.html" + importPage="https://p.eagate.573.jp/game/dan/1st/top/index.html#play_his" + scripts={[{ + name: "e-amusement Recently Played Score Export Userscript (Last 20 Played)", + url: "https://github.com/pinapelz/Mirage/raw/refs/heads/main/scripts/dancerush/dancerush_play_history.user.js" + }]} /> )} {isDanceAroundModalOpen && ( - <DanceAroundModal + <EamusementUserscriptModal isOpen={isDanceAroundModalOpen} onClose={() => setIsDanceAroundModalOpen(false)} - game={ - supportedGames.find((g) => g.internalName === selectedGame) || - undefined - } + mainGameName="DANCE aROUND" + userPage="https://p.eagate.573.jp/game/around/1st/top/index.html" + importPage="https://p.eagate.573.jp/game/around/1st/top/index.html#play_hist" + scripts={[{ + name: "e-amusement Recently Played Score Export Userscript (Last 20 Played)", + url: "https://github.com/pinapelz/Mirage/raw/refs/heads/main/scripts/dancearound/dancearound_play_history.user.js" + }]} /> )} {isDivaNetModalOpen && ( |
