diff --git a/.env b/.env index 95631677315e4d80243a533d25877337ebcb7778..5b162e16e35eb45c4b4661ab96f1232c1b81b470 100644 --- a/.env +++ b/.env @@ -1,3 +1,5 @@ +# Team ID +VITE_TEAM_ID=TeamID # Team name VITE_TEAM_NAME=TeamName # Team year diff --git a/src/components/AttributionForm/index.tsx b/src/components/AttributionForm/index.tsx index 4f358aa2f513d404178f8cba7a52c401ef54fba5..7d1f8c6eaec09bc439f1fbe69b81557395c03752 100644 --- a/src/components/AttributionForm/index.tsx +++ b/src/components/AttributionForm/index.tsx @@ -1,9 +1,9 @@ function AttributionForm() { - const team_name = import.meta.env.VITE_TEAM_NAME; + const team_id = import.meta.env.VITE_TEAM_ID; // Listen to size change and update form height window.addEventListener("message", function (e) { - if (e.origin === "https://attributions.igem.org") { + if (e.origin === "https://teams.igem.org") { const { type, data } = JSON.parse(e.data); if (type === "igem-attribution-form") { const element = document.getElementById("igem-attribution-form"); @@ -19,7 +19,7 @@ function AttributionForm() { <iframe style={{ width: "100%" }} id="igem-attribution-form" - src={`https://attributions.igem.org?team=${team_name}&year=2024`} + src={`https://teams.igem.org/${team_id}/attributions`} /> </> ); diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts index 95c2059d0faf2de85f02aaad81156064e0190100..ac924403a6d0eb15ea92b0e3388f70436ea190c3 100644 --- a/src/vite-env.d.ts +++ b/src/vite-env.d.ts @@ -1,6 +1,7 @@ /// <reference types="vite/client" /> interface ImportMetaEnv { + readonly VITE_TEAM_ID: string; readonly VITE_TEAM_NAME: string; readonly VITE_TEAM_YEAR: string; }