From 8b516d6f6888058203b0113693fff2cab2d1ae4c Mon Sep 17 00:00:00 2001 From: Marc Wieland Date: Thu, 5 Jun 2025 16:03:17 +0200 Subject: [PATCH] Added scoreboard integration --- .env.local | 2 +- src/App.tsx | 30 +++++---- src/admin/TeamDetail.tsx | 20 ++++++ src/components/TeamSection.tsx | 8 ++- src/pages/TeamDetailPage.tsx | 116 ++++++++++++++++++++++++++++----- 5 files changed, 142 insertions(+), 34 deletions(-) diff --git a/.env.local b/.env.local index 8ed0e6b43..0201757c1 100644 --- a/.env.local +++ b/.env.local @@ -1 +1 @@ -VITE_API_URL=http://localhost:5000 +VITE_API_URL=http://192.168.50.65:3000 diff --git a/src/App.tsx b/src/App.tsx index c255c9f0b..c5c1fe642 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -14,20 +14,22 @@ const queryClient = new QueryClient(); const App = () => ( - - - - - - - - } /> - {/* ADD ALL CUSTOM ROUTES ABOVE THE CATCH-ALL "*" ROUTE */} - } /> - - - - +
+ + + + + + + + } /> + } /> + + + + +
); + export default App; diff --git a/src/admin/TeamDetail.tsx b/src/admin/TeamDetail.tsx index 0e25385b2..a548f75d3 100644 --- a/src/admin/TeamDetail.tsx +++ b/src/admin/TeamDetail.tsx @@ -38,6 +38,9 @@ const TeamDetail = () => { const [players, setPlayers] = useState([]); const [loading, setLoading] = useState(true); + const [spielelink, setSpielelink] = useState(""); + const [scraper_Identifier, setScraperIdentifier] = useState(""); + const fetchTeam = async () => { try { const res = await fetch(`${apiBase}/api/teams/${id}`); @@ -57,6 +60,10 @@ const TeamDetail = () => { setBeschreibung(data.beschreibung ?? ""); setTabellenlink(data.tabellenlink ?? ""); setPlayers(data.players ?? []); + + setSpielelink(data.spielelink ?? ""); + setScraperIdentifier(data.scraper_identifier ?? ""); + } catch (err) { console.error("Fehler beim Laden des Teams:", err); } finally { @@ -87,6 +94,8 @@ const TeamDetail = () => { teamfarben, beschreibung, tabellenlink, + spielelink, + scraper_Identifier }), }); @@ -166,6 +175,17 @@ const TeamDetail = () => {