Added localstorage data

This commit is contained in:
Sean Edmunds
2025-01-31 15:16:42 -06:00
parent 9430db990b
commit cc46bb0402
5 changed files with 72 additions and 56 deletions

View File

@@ -25,6 +25,24 @@ export function useCommonHooks() {
const [searchValue, setSearchValue] = useState('');
const [providerLabel, setProviderLabel] = useState('Google Search');
const [providerURL, setProviderURL] = useState('https://www.google.com/search?q=');
const [currentUser, setCurrentUser] = useLocalStorage<any>({
key: 'user',
defaultValue: {
firstName: 'First',
lastName: 'Last',
},
});
const [currentLocation, setCurrentLocation] = useLocalStorage<any>({
key: 'location',
defaultValue: {
office: 'HGX',
station: 'KHOU',
x: 65,
y: 96,
lat: 29.750950134386066,
lon: -95.36220654860034,
},
});
const handleThemeChange = (themes: any, save: any) => {
const enabled = themes
@@ -59,5 +77,9 @@ export function useCommonHooks() {
setProviderLabel,
providerURL,
setProviderURL,
currentUser,
setCurrentUser,
currentLocation,
setCurrentLocation,
};
}