Navigate to your {game.formattedName} score data page
+ )}
+ {EamuseImportInfo[game.internalName] ? (
+
+ Install the userscript to your browser (use an extension such
+ as Tampermonkey)
+
+ ) : (
+
+ Scrape the data using any method of your choice and translate
+ it into a Mirage {game.formattedName} compatible JSON format
+
+ )}
+
Upload the resulting JSON file into Mirage using the Batch-Manual Upload functionality
+
Verify that all data has been imported correctly
+
+
+
+ {/* Additional Info */}
+
+
+ This feature is currently under development. Please check back
+ later for the full implementation.
+
+
+
+ {/* Actions */}
+
+
+
+
+
+
+ );
+};
+
+export default EamusementUploadModal;
diff --git a/frontend/src/components/modals/JsonUploadModal.tsx b/frontend/src/components/modals/JsonUploadModal.tsx
index 1cb541b..7d8f838 100644
--- a/frontend/src/components/modals/JsonUploadModal.tsx
+++ b/frontend/src/components/modals/JsonUploadModal.tsx
@@ -3,6 +3,8 @@ import { useState, useRef } from 'react';
interface JsonUploadModalProps {
isOpen: boolean;
onClose: () => void;
+ // has to be any as this is a dynamic trackerm with dynamic score formats
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
onUpload: (data: any) => void;
game: string;
}
diff --git a/frontend/src/contexts/AuthContext.tsx b/frontend/src/contexts/AuthContext.tsx
index 7e2668d..8abeeb4 100644
--- a/frontend/src/contexts/AuthContext.tsx
+++ b/frontend/src/contexts/AuthContext.tsx
@@ -1,7 +1,7 @@
import React, { createContext, useContext, useState, useEffect } from 'react';
import type { ReactNode } from 'react';
-import { authApi } from '../utils/api';
-import type { User as ApiUser, SessionResponse } from '../utils/api';
+import { authApi } from '../utils/authApi';
+import type { User as ApiUser, SessionResponse } from '../utils/authApi';
interface User {
id: string;
diff --git a/frontend/src/pages/Game.tsx b/frontend/src/pages/Game.tsx
new file mode 100644
index 0000000..e69de29
diff --git a/frontend/src/pages/Home.tsx b/frontend/src/pages/Home.tsx
index e42a2b8..0ee6862 100644
--- a/frontend/src/pages/Home.tsx
+++ b/frontend/src/pages/Home.tsx
@@ -1,8 +1,14 @@
import { Link, useNavigate } from 'react-router';
import { useAuth } from '../contexts/AuthContext';
+import type { SupportedGame } from '../types/game';
+import { useState, useEffect } from 'react';
+
+import dancerushImage from '../assets/games/dancerush.webp';
const Home = () => {
const { user, isLoading, logout } = useAuth();
+ const [supportedGames, setSupportedGames] = useState([]);
+ const [gamesLoading, setGamesLoading] = useState(true);
const navigate = useNavigate();
const handleLogout = async () => {
@@ -15,7 +21,37 @@ const Home = () => {
}
};
- if (isLoading) {
+ const getGameImage = (internalName: string) => {
+ switch(internalName){
+ case "dancerush": {
+ return dancerushImage;
+ }
+ default: {
+ return null
+ }
+ }
+ }
+
+ useEffect(() => {
+ const fetchSupportedGames = async () => {
+ try {
+ const response = await fetch(import.meta.env.VITE_API_URL+'/supportedGames');
+ if (!response.ok) {
+ throw new Error('Failed to fetch supported games');
+ }
+ const data = await response.json();
+ setSupportedGames(data);
+ } catch (error) {
+ console.error('Failed to fetch supported games:', error);
+ alert('Failed to load supported games. Please refresh the page.');
+ } finally {
+ setGamesLoading(false);
+ }
+ };
+ fetchSupportedGames();
+ }, []);
+
+ if (isLoading || gamesLoading) {
return (
@@ -92,31 +128,40 @@ const Home = () => {
Track your rhythm game progress and performance
- {/* Coming Soon Card */}
-
-
-
-
-
Dashboard Coming Soon
-
- We're working hard to bring you an amazing dashboard experience. Track your scores,
- analyze your performance, and compete with friends - all coming soon!
-