mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-05 06:28:51 +00:00
feat(settings): utilze useLocalStorage
This commit is contained in:
1 parent
6458bce17f
commit
5af6e4936d
1 file changed
+7
-10
@@ -24,10 +24,7 @@ import {
|
|||||||
} from '@material-ui/icons';
|
} from '@material-ui/icons';
|
||||||
|
|
||||||
import { ListSubheader } from '@material-ui/core';
|
import { ListSubheader } from '@material-ui/core';
|
||||||
import useLocalStorage, {
|
import useLocalStorage from '../../../os/phone/hooks/useLocalStorage';
|
||||||
writeStorage,
|
|
||||||
getStorage,
|
|
||||||
} from '../../../os/phone/hooks/useLocalStorage';
|
|
||||||
|
|
||||||
const SubHeaderComp = (props: { text: string }) => (
|
const SubHeaderComp = (props: { text: string }) => (
|
||||||
<ListSubheader component='div' disableSticky>
|
<ListSubheader component='div' disableSticky>
|
||||||
@@ -72,7 +69,7 @@ export const SettingsApp = () => {
|
|||||||
|
|
||||||
// TODO: These new settings all work
|
// TODO: These new settings all work
|
||||||
|
|
||||||
useEffect(() => {}, [getStorage]);
|
useEffect(() => {}, [theme]);
|
||||||
|
|
||||||
const [openMenu, closeMenu, ContextMenu, isMenuOpen] = useContextMenu();
|
const [openMenu, closeMenu, ContextMenu, isMenuOpen] = useContextMenu();
|
||||||
return (
|
return (
|
||||||
@@ -87,7 +84,7 @@ export const SettingsApp = () => {
|
|||||||
/>
|
/>
|
||||||
<SettingItem
|
<SettingItem
|
||||||
label='Ringtone'
|
label='Ringtone'
|
||||||
value={getStorage('ringtone')}
|
value={ringtone}
|
||||||
options={ringtones}
|
options={ringtones}
|
||||||
onClick={openMenu}
|
onClick={openMenu}
|
||||||
icon={<LibraryMusic />}
|
icon={<LibraryMusic />}
|
||||||
@@ -107,28 +104,28 @@ export const SettingsApp = () => {
|
|||||||
<List disablePadding subheader={<SubHeaderComp text='Appearance' />}>
|
<List disablePadding subheader={<SubHeaderComp text='Appearance' />}>
|
||||||
<SettingItem
|
<SettingItem
|
||||||
label='Theme'
|
label='Theme'
|
||||||
value={getStorage('theme')}
|
value={theme}
|
||||||
options={themes}
|
options={themes}
|
||||||
onClick={openMenu}
|
onClick={openMenu}
|
||||||
icon={<Brush />}
|
icon={<Brush />}
|
||||||
/>
|
/>
|
||||||
<SettingItem
|
<SettingItem
|
||||||
label='Wallpaper'
|
label='Wallpaper'
|
||||||
value={getStorage('wallpaper')}
|
value={wallpaper}
|
||||||
options={wallpapers}
|
options={wallpapers}
|
||||||
onClick={openMenu}
|
onClick={openMenu}
|
||||||
icon={<Wallpaper />}
|
icon={<Wallpaper />}
|
||||||
/>
|
/>
|
||||||
<SettingItem
|
<SettingItem
|
||||||
label='Frame'
|
label='Frame'
|
||||||
value={getStorage('frame')}
|
value={frame}
|
||||||
options={frames}
|
options={frames}
|
||||||
onClick={openMenu}
|
onClick={openMenu}
|
||||||
icon={<Smartphone />}
|
icon={<Smartphone />}
|
||||||
/>
|
/>
|
||||||
<SettingItem
|
<SettingItem
|
||||||
label='Zoom'
|
label='Zoom'
|
||||||
value={getStorage('zoom')}
|
value={zoom}
|
||||||
options={zoomOptions}
|
options={zoomOptions}
|
||||||
onClick={openMenu}
|
onClick={openMenu}
|
||||||
icon={<ZoomIn />}
|
icon={<ZoomIn />}
|
||||||
|
|||||||
Reference in new issue
Block a user