Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Imperial79 committed Mar 21, 2024
1 parent bf8bcb4 commit 28d2218
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
12 changes: 12 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
},
"dependencies": {
"axios": "^1.6.8",
"dotenv": "^16.4.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-geolocated": "^4.1.2",
Expand Down
7 changes: 5 additions & 2 deletions frontend/src/Screens/Authentication/Register.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import React, { useEffect, useState } from "react";
import axios from "axios";
import { useGeolocated } from "react-geolocated";
import dotenv from "dotenv";

dotenv.config();

export const Register = () => {
const [name, setName] = useState("");
Expand All @@ -9,7 +12,7 @@ export const Register = () => {
const [latitude, setLatitude] = useState("");
const [longitude, setLongitude] = useState("");
const [addressList, setAddressList] = useState([]);

console.log(process.env.GMAPS_API);
const { coords, isGeolocationAvailable, isGeolocationEnabled } =
useGeolocated({
positionOptions: {
Expand All @@ -35,7 +38,7 @@ export const Register = () => {
// );
// setDisplayAddress(res2.data.display_name);
var res2 = await axios.get(
`https://maps.googleapis.com/maps/api/geocode/json?latlng=${coords.latitude},${coords.longitude}&key=${process.env.GMAPS_API}`
`https://maps.googleapis.com/maps/api/geocode/json?latlng=${coords.latitude},${coords.longitude}&key=${process.env.REACT_APP_GMAPS_API}`
);
// setDisplayAddress(res2.data.display_name);
res2.data.results.map((_, index) => {
Expand Down
5 changes: 5 additions & 0 deletions frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,11 @@ doctrine@^3.0.0:
dependencies:
esutils "^2.0.2"

dotenv@^16.4.5:
version "16.4.5"
resolved "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz"
integrity sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==

eastasianwidth@^0.2.0:
version "0.2.0"
resolved "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz"
Expand Down

0 comments on commit 28d2218

Please sign in to comment.