Archived
refetch backgrounds
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import { createTagOrder } from '~/api/get-apps';
|
import { createTagOrder } from '~/api/get-apps';
|
||||||
|
import { Settings } from '../widgets/Settings';
|
||||||
import style from './Sidebar.module.css';
|
import style from './Sidebar.module.css';
|
||||||
|
|
||||||
type SidebarProps = {
|
type SidebarProps = {
|
||||||
@@ -22,6 +23,7 @@ export function Sidebar(props: SidebarProps) {
|
|||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
|
<Settings className={style.Settings} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,25 +1,29 @@
|
|||||||
import {
|
import {
|
||||||
Modal,
|
|
||||||
ModalOverlay,
|
|
||||||
ModalContent,
|
|
||||||
ModalCloseButton,
|
|
||||||
ModalHeader,
|
|
||||||
ModalBody,
|
|
||||||
Checkbox,
|
|
||||||
ModalFooter,
|
|
||||||
Button,
|
Button,
|
||||||
|
Checkbox,
|
||||||
Flex,
|
Flex,
|
||||||
|
Modal,
|
||||||
|
ModalBody,
|
||||||
|
ModalCloseButton,
|
||||||
|
ModalContent,
|
||||||
|
ModalFooter,
|
||||||
|
ModalHeader,
|
||||||
|
ModalOverlay,
|
||||||
createDisclosure,
|
createDisclosure,
|
||||||
} from '@hope-ui/solid';
|
} from '@hope-ui/solid';
|
||||||
import { HiSolidCog } from 'solid-icons/hi';
|
import { HiOutlineTrash, HiSolidCog } from 'solid-icons/hi';
|
||||||
import { useSettings } from '~/state/SettingsProvider';
|
import { useSettings } from '~/state/SettingsProvider';
|
||||||
|
|
||||||
export function Settings() {
|
type SettingsProps = {
|
||||||
|
className?: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export function Settings(props: SettingsProps) {
|
||||||
const { appSettings, setAppSettings } = useSettings();
|
const { appSettings, setAppSettings } = useSettings();
|
||||||
const { isOpen, onOpen, onClose } = createDisclosure();
|
const { isOpen, onOpen, onClose } = createDisclosure();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<div class={props.className}>
|
||||||
<HiSolidCog onClick={onOpen} size={24} />
|
<HiSolidCog onClick={onOpen} size={24} />
|
||||||
|
|
||||||
<Modal opened={isOpen()} onClose={onClose}>
|
<Modal opened={isOpen()} onClose={onClose}>
|
||||||
@@ -37,14 +41,16 @@ export function Settings() {
|
|||||||
>
|
>
|
||||||
Show locations
|
Show locations
|
||||||
</Checkbox>
|
</Checkbox>
|
||||||
<Checkbox
|
<a
|
||||||
checked={appSettings.viewAsTable}
|
style={{ display: 'flex', 'align-items': 'center', gap: '8px', cursor: 'pointer' }}
|
||||||
onChange={(e) =>
|
onClick={() => {
|
||||||
setAppSettings((prev) => ({ ...prev, viewAsTable: (e.target as any).checked }))
|
localStorage.removeItem('start-page-background');
|
||||||
}
|
window.location.reload();
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
Table View
|
<HiOutlineTrash size={16} />
|
||||||
</Checkbox>
|
Reload background
|
||||||
|
</a>
|
||||||
</Flex>
|
</Flex>
|
||||||
</ModalBody>
|
</ModalBody>
|
||||||
<ModalFooter>
|
<ModalFooter>
|
||||||
@@ -52,6 +58,6 @@ export function Settings() {
|
|||||||
</ModalFooter>
|
</ModalFooter>
|
||||||
</ModalContent>
|
</ModalContent>
|
||||||
</Modal>
|
</Modal>
|
||||||
</>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user