Starting physical address lookups
This commit is contained in:
@@ -3,7 +3,7 @@ import { appTheme } from 'contexts';
|
||||
import { useAtom } from 'jotai';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { toast } from 'react-toastify';
|
||||
import { useQueryAPI, useWeatherAPI } from './useAPI';
|
||||
import { useCensusAPI, useQueryAPI, useWeatherAPI } from './useAPI';
|
||||
|
||||
export function useCommonHooks() {
|
||||
const isMobile = window.matchMedia('(max-width: 600px)').matches;
|
||||
@@ -161,6 +161,18 @@ export function useCommonHooks() {
|
||||
}
|
||||
}, [wolClients, wolClientsIsFetched]);
|
||||
|
||||
const { data: locationData } = useCensusAPI({
|
||||
address: personalData?.[0]?.physicalAddress,
|
||||
});
|
||||
|
||||
const [location, setLocation] = useState<any>([]);
|
||||
|
||||
useEffect(() => {
|
||||
if (locationData) {
|
||||
setLocation(locationData);
|
||||
}
|
||||
}, [locationData]);
|
||||
|
||||
return {
|
||||
isMobile,
|
||||
theme,
|
||||
@@ -222,6 +234,7 @@ export function useCommonHooks() {
|
||||
wolClientsIsFetched,
|
||||
wolClientsIsFetching,
|
||||
wolClientsIsLoading,
|
||||
location,
|
||||
notify,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user