Typing and Density settings
This commit is contained in:
@@ -1,2 +1,7 @@
|
||||
export { useQueryAPI, useWeatherAPI, useMutationAPI, useOSMAPI } from './useAPI';
|
||||
export {
|
||||
useQueryAPI,
|
||||
useWeatherAPI,
|
||||
useMutationAPI,
|
||||
useOSMAPI,
|
||||
} from './useAPI';
|
||||
export { useCommonHooks } from './useCommonHooks';
|
||||
|
||||
@@ -2,7 +2,7 @@ import { useLocalStorage } from '@mantine/hooks';
|
||||
import { appTheme } from 'contexts';
|
||||
import { useAtom } from 'jotai';
|
||||
import { useState } from 'react';
|
||||
import type { Theme } from 'types';
|
||||
import type { Location, Theme, User } from 'types';
|
||||
import { useMutationAPI } from './useAPI';
|
||||
|
||||
export function useCommonHooks() {
|
||||
@@ -21,6 +21,10 @@ export function useCommonHooks() {
|
||||
key: 'appSort',
|
||||
defaultValue: 'A>Z',
|
||||
});
|
||||
const [appDensity, setAppDensity] = useLocalStorage<number>({
|
||||
key: 'appDensity',
|
||||
defaultValue: 6,
|
||||
});
|
||||
const [bookmarkSort, setBookmarkSort] = useLocalStorage<string>({
|
||||
key: 'bookmarkSort',
|
||||
defaultValue: 'A>Z',
|
||||
@@ -29,6 +33,10 @@ export function useCommonHooks() {
|
||||
key: 'bookmarkFilter',
|
||||
defaultValue: ['All'],
|
||||
});
|
||||
const [bookmarkDensity, setBookmarkDensity] = useLocalStorage<number>({
|
||||
key: 'bookmarkDensity',
|
||||
defaultValue: 5,
|
||||
});
|
||||
const [currentTheme, setCurrentTheme] = useLocalStorage<string>({
|
||||
key: 'theme',
|
||||
defaultValue: 'blackboard',
|
||||
@@ -43,14 +51,16 @@ export function useCommonHooks() {
|
||||
const [providerLabel, setProviderLabel] = useState('Google Search');
|
||||
const [providerURL, setProviderURL] = useState('https://www.google.com/search?q=');
|
||||
const [providerPrefix, setProviderPrefix] = useState('/g');
|
||||
const [currentUser, setCurrentUser] = useLocalStorage<any>({
|
||||
const [currentUser, setCurrentUser] = useLocalStorage<User>({
|
||||
key: 'user',
|
||||
defaultValue: {
|
||||
firstName: 'First',
|
||||
lastName: 'Last',
|
||||
email: 'triggerUser@default.com',
|
||||
physicalAddress: '1510 Polk St, Houston, TX 77002',
|
||||
},
|
||||
});
|
||||
const [currentLocation, setCurrentLocation] = useLocalStorage<any>({
|
||||
const [currentLocation, setCurrentLocation] = useLocalStorage<Location>({
|
||||
key: 'location',
|
||||
defaultValue: {
|
||||
office: 'HGX',
|
||||
@@ -133,10 +143,14 @@ export function useCommonHooks() {
|
||||
setAppFilter,
|
||||
appSort,
|
||||
setAppSort,
|
||||
appDensity,
|
||||
setAppDensity,
|
||||
bookmarkSort,
|
||||
setBookmarkSort,
|
||||
bookmarkFilter,
|
||||
setBookmarkFilter,
|
||||
bookmarkDensity,
|
||||
setBookmarkDensity,
|
||||
currentTheme,
|
||||
setCurrentTheme,
|
||||
currentThemePlaylist,
|
||||
|
||||
Reference in New Issue
Block a user