mirror of
https://github.com/modrinth/code.git
synced 2026-08-30 11:36:05 +00:00
* refactor: migrate to common eslint+prettier configs
* fix: prettier frontend
* feat: config changes
* fix: lint issues
* fix: lint
* fix: type imports
* fix: cyclical import issue
* fix: lockfile
* fix: missing dep
* fix: switch to tabs
* fix: continue switch to tabs
* fix: rustfmt parity
* fix: moderation lint issue
* fix: lint issues
* fix: ui intl
* fix: lint issues
* Revert "fix: rustfmt parity"
This reverts commit cb99d2376c.
* feat: revert last rs
42 lines
1.1 KiB
Vue
42 lines
1.1 KiB
Vue
<script setup lang="ts">
|
|
import { Toggle } from '@modrinth/ui'
|
|
import { ref, watch } from 'vue'
|
|
|
|
import { get as getSettings, set as setSettings } from '@/helpers/settings.ts'
|
|
import { useTheming } from '@/store/state'
|
|
import { DEFAULT_FEATURE_FLAGS, type FeatureFlag } from '@/store/theme.ts'
|
|
|
|
const themeStore = useTheming()
|
|
|
|
const settings = ref(await getSettings())
|
|
const options = ref<FeatureFlag[]>(Object.keys(DEFAULT_FEATURE_FLAGS))
|
|
|
|
function setFeatureFlag(key: string, value: boolean) {
|
|
themeStore.featureFlags[key] = value
|
|
settings.value.feature_flags[key] = value
|
|
}
|
|
|
|
watch(
|
|
settings,
|
|
async () => {
|
|
await setSettings(settings.value)
|
|
},
|
|
{ deep: true },
|
|
)
|
|
</script>
|
|
<template>
|
|
<div v-for="option in options" :key="option" class="mt-4 flex items-center justify-between">
|
|
<div>
|
|
<h2 class="m-0 text-lg font-extrabold text-contrast capitalize">
|
|
{{ option.replaceAll('_', ' ') }}
|
|
</h2>
|
|
</div>
|
|
|
|
<Toggle
|
|
id="advanced-rendering"
|
|
:model-value="themeStore.getFeatureFlag(option)"
|
|
@update:model-value="() => setFeatureFlag(option, !themeStore.getFeatureFlag(option))"
|
|
/>
|
|
</div>
|
|
</template>
|