From cc197c39c06eabcb3cb38fc7cca6b13792b137d5 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Wed, 17 Dec 2025 13:05:31 -0800 Subject: create seperate module for EAG import methods for clarity --- .../src/components/modals/EagleUserscriptModal.tsx | 169 +++++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 frontend/src/components/modals/EagleUserscriptModal.tsx (limited to 'frontend/src/components/modals/EagleUserscriptModal.tsx') diff --git a/frontend/src/components/modals/EagleUserscriptModal.tsx b/frontend/src/components/modals/EagleUserscriptModal.tsx new file mode 100644 index 0000000..a7d1652 --- /dev/null +++ b/frontend/src/components/modals/EagleUserscriptModal.tsx @@ -0,0 +1,169 @@ +interface UserScript { + name: string; + url: string; +} + +interface EagleUserscriptModalProps { + isOpen: boolean; + onClose: () => void; + mainGameName: string; + userPage: string; + importPage: string; + scripts: UserScript[]; +} + +interface EagleUserscriptCardProps { + mainGameName: string; + onClick: () => void; +} + +export const EagleUserscriptCard = ({ mainGameName, onClick }: EagleUserscriptCardProps) => { + return ( +
+
+ + + +
+

+ {mainGameName} Eagle Play History (Userscript) +

+

+ Import playdata from cabinets on the Eagle network +

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

+ Import {mainGameName} Eagle Play Data +

+

+ Follow the instructions below to import your data +

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

+ You will need your ACCESS CODE to register on Eagle for the first time!

+ Do this by tapping your Amusement IC card at any machine on the Eagle network and copying + down the code displayed on the screen. +

+ This is likely not the same code as the one on the back of your card. +

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

+ Instructions: +

+
    +
  1. + Log into the{" "} + + {mainGameName} Eagle page + +
  2. +
  3. + Navigate to the{" "} + + {mainGameName} Play History Page + {" "} +
  4. +
  5. + Install the relevant userscript (use a browser extension such as{" "} + Violentmonkey) +
  6. + {/* Additional Info */} +
    +

    + {scripts.map(userscript => ( + + {userscript.name} + + ))} +

    +
    +
  7. + A button will appear on the page that you can click to start the scraping process. +
  8. +
  9. + Upload the resulting JSON file into Mirage using the + Batch-Manual Upload functionality +
  10. +
  11. Verify that all data has been imported correctly
  12. +
+
+ + {/* Actions */} +
+ +
+
+
+
+ ); +}; + +export default EagleUserscriptModal; \ No newline at end of file -- cgit v1.2.3