Settings refactor and redesign (#1669)

* new settings work

* Polishing work on settings refactor

* Run intl:extract

* List view -> Rows view

* Remove current preferred system theme indicator to make the themes fit on one line

* Remove extra margin on top of navstack
This commit is contained in:
Prospector
2024-04-09 11:18:56 -07:00
committed by GitHub
parent ae2d83c8aa
commit 4c2565826f
22 changed files with 1242 additions and 378 deletions

View File

@@ -17,6 +17,7 @@ export const useCosmetics = () =>
developerMode: false,
notUsingBlockers: false,
hideModrinthAppPromos: false,
preferredDarkTheme: 'dark',
searchDisplayMode: {
mod: 'list',
plugin: 'list',

View File

@@ -24,6 +24,7 @@ export const useTheme = () =>
export const updateTheme = (value, updatePreference = false) => {
const theme = useTheme()
const cosmetics = useCosmetics()
const themeCookie = useCookie('color-mode', {
maxAge: 60 * 60 * 24 * 365 * 10,
@@ -40,7 +41,7 @@ export const updateTheme = (value, updatePreference = false) => {
if (colorSchemeQueryList.matches) {
theme.value.value = 'light'
} else {
theme.value.value = 'dark'
theme.value.value = cosmetics.value.preferredDarkTheme
}
} else {
theme.value.value = value
@@ -53,3 +54,5 @@ export const updateTheme = (value, updatePreference = false) => {
themeCookie.value = theme.value
}
export const DARK_THEMES = ['dark', 'oled', 'retro']