Loading web/src/components/map/map.tsx +9 −1 Original line number Diff line number Diff line Loading @@ -2,8 +2,14 @@ import { GoogleMap, Marker, useLoadScript } from "@react-google-maps/api"; import { useState, useMemo } from "react"; import { REACT_APP_GOOGLE_API_KEY } from "../../constants/api_keys"; import { LoadingScreen } from "../loading_screen/loading_screen"; import { UseFormSetValue } from "react-hook-form"; import { PlaceFormValues } from "../../infraestructure/entities/place"; export const MapComponent = () => { interface props{ setValue: UseFormSetValue<PlaceFormValues>; } export const MapComponent = ({setValue}: props) => { const {isLoaded} = useLoadScript({ googleMapsApiKey: REACT_APP_GOOGLE_API_KEY }); Loading @@ -15,6 +21,8 @@ export const MapComponent = () => { setMarker(true); setLatitude(event.latLng.lat()); setLongitude(event.latLng.lng()); setValue("latitude", event.latLng.lat(), {shouldValidate: true}); setValue("longitude", event.latLng.lng(), {shouldValidate: true}); } } Loading Loading
web/src/components/map/map.tsx +9 −1 Original line number Diff line number Diff line Loading @@ -2,8 +2,14 @@ import { GoogleMap, Marker, useLoadScript } from "@react-google-maps/api"; import { useState, useMemo } from "react"; import { REACT_APP_GOOGLE_API_KEY } from "../../constants/api_keys"; import { LoadingScreen } from "../loading_screen/loading_screen"; import { UseFormSetValue } from "react-hook-form"; import { PlaceFormValues } from "../../infraestructure/entities/place"; export const MapComponent = () => { interface props{ setValue: UseFormSetValue<PlaceFormValues>; } export const MapComponent = ({setValue}: props) => { const {isLoaded} = useLoadScript({ googleMapsApiKey: REACT_APP_GOOGLE_API_KEY }); Loading @@ -15,6 +21,8 @@ export const MapComponent = () => { setMarker(true); setLatitude(event.latLng.lat()); setLongitude(event.latLng.lng()); setValue("latitude", event.latLng.lat(), {shouldValidate: true}); setValue("longitude", event.latLng.lng(), {shouldValidate: true}); } } Loading