From 2b33a70cc1166946b48a46310ea5a8225d570bc1 Mon Sep 17 00:00:00 2001 From: Georgi Gardev Date: Sat, 18 Nov 2023 18:06:08 +0200 Subject: [PATCH] refetch backgrounds --- src/components/ui/Sidebar.tsx | 2 ++ src/components/widgets/Settings.tsx | 44 ++++++++++++++++------------- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/src/components/ui/Sidebar.tsx b/src/components/ui/Sidebar.tsx index 92daf54..7c97f2f 100644 --- a/src/components/ui/Sidebar.tsx +++ b/src/components/ui/Sidebar.tsx @@ -1,4 +1,5 @@ import { createTagOrder } from '~/api/get-apps'; +import { Settings } from '../widgets/Settings'; import style from './Sidebar.module.css'; type SidebarProps = { @@ -22,6 +23,7 @@ export function Sidebar(props: SidebarProps) { ))} + ); } diff --git a/src/components/widgets/Settings.tsx b/src/components/widgets/Settings.tsx index 14071cb..e1c0764 100644 --- a/src/components/widgets/Settings.tsx +++ b/src/components/widgets/Settings.tsx @@ -1,25 +1,29 @@ import { - Modal, - ModalOverlay, - ModalContent, - ModalCloseButton, - ModalHeader, - ModalBody, - Checkbox, - ModalFooter, Button, + Checkbox, Flex, + Modal, + ModalBody, + ModalCloseButton, + ModalContent, + ModalFooter, + ModalHeader, + ModalOverlay, createDisclosure, } from '@hope-ui/solid'; -import { HiSolidCog } from 'solid-icons/hi'; +import { HiOutlineTrash, HiSolidCog } from 'solid-icons/hi'; import { useSettings } from '~/state/SettingsProvider'; -export function Settings() { +type SettingsProps = { + className?: string; +}; + +export function Settings(props: SettingsProps) { const { appSettings, setAppSettings } = useSettings(); const { isOpen, onOpen, onClose } = createDisclosure(); return ( - <> +
@@ -37,14 +41,16 @@ export function Settings() { > Show locations - - setAppSettings((prev) => ({ ...prev, viewAsTable: (e.target as any).checked })) - } + { + localStorage.removeItem('start-page-background'); + window.location.reload(); + }} > - Table View - + + Reload background + @@ -52,6 +58,6 @@ export function Settings() { - +
); }