From 8f58a9a1816b31dd7407a04c5a589dc92000c301 Mon Sep 17 00:00:00 2001 From: Xyphyn Date: Wed, 9 Aug 2023 10:44:26 -0700 Subject: [PATCH] design: switch to checkboxes in settings menu --- src/lib/settings.ts | 2 + src/routes/settings/+page.svelte | 102 ++++++++++++----------------- src/routes/settings/Setting.svelte | 8 ++- 3 files changed, 48 insertions(+), 64 deletions(-) diff --git a/src/lib/settings.ts b/src/lib/settings.ts index 9ecb7c23..e5988b39 100644 --- a/src/lib/settings.ts +++ b/src/lib/settings.ts @@ -20,6 +20,7 @@ interface Settings { hidePosts: { deleted: boolean removed: boolean + read: boolean } fullWidthLayout: boolean expandSidebar: boolean @@ -49,6 +50,7 @@ const defaultSettings: Settings = { hidePosts: { deleted: true, removed: false, + read: false, }, fullWidthLayout: false, expandSidebar: true, diff --git a/src/routes/settings/+page.svelte b/src/routes/settings/+page.svelte index b15fe90e..bb2eb8d6 100644 --- a/src/routes/settings/+page.svelte +++ b/src/routes/settings/+page.svelte @@ -7,6 +7,7 @@ import { toast } from '$lib/components/ui/toasts/toasts.js' import Button from '$lib/components/input/Button.svelte' import { getInboxNotifications } from '$lib/auth.js' + import Checkbox from '$lib/components/input/Checkbox.svelte' let data = { loading: false, @@ -37,81 +38,60 @@ -

UI

- - Mark read posts - Fade the title of posts you've already read. - - - - Revert vote colors - - Make upvotes orange and downvotes blue, like Reddit used to do. - - - - - Show compact posts - - Show posts with smaller thumbnails and without text bodies. - - - Hide Posts Hide certain types of posts. -
-
- Deleted Posts - -
-
- Removed Posts - -
+
+ + Deleted + + + Removed + + Read
+

UI

+ + + Mark read posts + + Fade the title of posts you've already read. + + + + Revert vote colors + + + Make upvotes orange and downvotes blue, like Reddit used to do. + + + + Post style + +

Instances

Show instances Show items' instances. - + Xylight @example.com -
-
- Users - -
-
+
+ Users + Comments - -
-
+ + Communities - -
+
-

Notifications

- - Push notifications - Get notified for new items in your inbox. - { - if (e.detail == false) return - const res = await Notification.requestPermission() - if (res != 'granted') { - $userSettings.notifications.enabled = false - toast({ - content: 'Notification permission denied', - type: 'error', - }) - return - } - }} - /> -
diff --git a/src/routes/settings/Setting.svelte b/src/routes/settings/Setting.svelte index e25dd94f..4dfd8a43 100644 --- a/src/routes/settings/Setting.svelte +++ b/src/routes/settings/Setting.svelte @@ -4,8 +4,10 @@

-

- -

+ {#if $$slots.description} +

+ +

+ {/if}