From 59e1f333eaeaf259d89b7a2f33e7f2b25cd234b4 Mon Sep 17 00:00:00 2001 From: Graham Vasquez Date: Tue, 25 Feb 2025 20:33:16 -0500 Subject: [PATCH] refactor: update import, clearer name --- src/App.jsx | 4 ++-- .../GeolocationTracker/GeolocationTracker.jsx | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 889d5a05..8be1cb74 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -7,7 +7,7 @@ import MapPage from 'components/MapPage/MapPage'; import theme from 'theme'; import store from 'store'; import { Provider } from 'react-redux'; -import GeoLocationTracker from 'components/GeolocationTracker/GeolocationTracker'; +import GeolocationTracker from 'components/GeolocationTracker/GeolocationTracker'; const App = () => { initAnalytics(); @@ -15,7 +15,7 @@ const App = () => { return ( - +
diff --git a/src/components/GeolocationTracker/GeolocationTracker.jsx b/src/components/GeolocationTracker/GeolocationTracker.jsx index 62a70628..d1077e76 100644 --- a/src/components/GeolocationTracker/GeolocationTracker.jsx +++ b/src/components/GeolocationTracker/GeolocationTracker.jsx @@ -1,14 +1,14 @@ import { useEffect } from 'react'; import { useDispatch } from 'react-redux'; -import { updateUserLocationEnabled } from '../../reducers/user'; +import { updateUserLocationEnabled } from 'reducers/user'; -const GeoLocationTracker = () => { +const GeolocationTracker = () => { const dispatch = useDispatch(); useEffect(() => { function setUserLocationEnabled(payload) { dispatch(updateUserLocationEnabled(payload)); } - async function queryGeolocationPerms() { + async function queryGeolocationPermissions() { const perms = await navigator.permissions.query({ name: 'geolocation' }); setUserLocationEnabled(perms.state === 'granted'); perms.addEventListener('change', () => { @@ -55,7 +55,7 @@ const GeoLocationTracker = () => { ); // This is the sensible way to handle it... } else { - queryGeolocationPerms(); + queryGeolocationPermissions(); } return () => { clearInterval(interval); @@ -64,4 +64,4 @@ const GeoLocationTracker = () => { return null; }; -export default GeoLocationTracker; +export default GeolocationTracker;