feat: add color scheme actions

This commit is contained in:
Xylight committed 2024-07-20 13:33:37 -07:00
1 parent 69be40b4b7
commit e4555a0af9
2 files changed
+35 -1

No files matched your search

@@ -6,6 +6,7 @@ import {
import { resumables, type ResumableItem } from '$lib/lemmy/item'
import { userSettings } from '$lib/settings'
import { t } from '$lib/translations'
import { legacyTheme } from '$lib/ui/colors'
import { fullCommunityName } from '$lib/util'
import {
ArrowRightOnRectangle,
@@ -23,6 +24,10 @@ import {
UserGroup,
ViewColumns,
type IconSource,
PaintBrush,
ComputerDesktop,
Sun,
Moon,
} from 'svelte-hero-icons'
export interface Group {
@@ -181,6 +186,33 @@ export function getGroups(resumables: ResumableItem[], profile: Profile) {
},
],
},
{
name: t.get('nav.commands.setColor'),
icon: PaintBrush,
subActions: [
{
name: t.get('nav.commands.setColorTo', {
default: t.get('nav.menu.colorscheme.system'),
}),
handle: () => legacyTheme.set('system'),
icon: ComputerDesktop,
},
{
name: t.get('nav.commands.setColorTo', {
default: t.get('nav.menu.colorscheme.light'),
}),
handle: () => legacyTheme.set('light'),
icon: Sun,
},
{
name: t.get('nav.commands.setColorTo', {
default: t.get('nav.menu.colorscheme.dark'),
}),
handle: () => legacyTheme.set('dark'),
icon: Moon,
},
],
},
],
},
{
+3 -1
View File
@@ -40,7 +40,9 @@
"search": "Search for {{default}}",
"main": "Main",
"setView": "Set view",
"setViewTo": "Set view to {{default}}"
"setViewTo": "Set view to {{default}}",
"setColor": "Set color scheme",
"setColorTo": "Set color scheme to {{default}}"
}
},
"account": {