diff --git a/frontend/src/views/SetupPreferences/steps/Step1Preferences.tsx b/frontend/src/views/SetupPreferences/steps/Step1Preferences.tsx index cd26441..4ca35a1 100644 --- a/frontend/src/views/SetupPreferences/steps/Step1Preferences.tsx +++ b/frontend/src/views/SetupPreferences/steps/Step1Preferences.tsx @@ -1,6 +1,23 @@ import SimpleField from "@/components/forms/SimpleField"; +import { useEffect, useState } from "react"; + + const Step1Preferences = () => { + const [location, setLocation] = useState(""); + const getLocationFromBrowser = () => { + if (navigator.geolocation) { + navigator.geolocation.getCurrentPosition((position) => { + setLocation(position.coords.latitude + ", " + position.coords.longitude); + }); + } else { + console.log("Geolocation is not supported by this browser."); + } + } + + useEffect(() => { + getLocationFromBrowser(); + }); return (