Typing and Density settings

This commit is contained in:
Sean Edmunds
2025-04-21 17:27:26 -05:00
parent d9712974d9
commit c3495bd674
21 changed files with 531 additions and 343 deletions

View File

@@ -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,