mirror of
https://github.com/versia-pub/frontend.git
synced 2026-03-13 03:29:16 +01:00
feat: ✨ Add Enum preference type support
This commit is contained in:
parent
ca824a2a1a
commit
dca7af4b0e
10 changed files with 149 additions and 4 deletions
16
pages/global.vue
Normal file
16
pages/global.vue
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<template>
|
||||
<div class="mx-auto max-w-2xl w-full">
|
||||
<TimelineScroller>
|
||||
<Global />
|
||||
</TimelineScroller>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import Global from "~/components/timelines/global.vue";
|
||||
import TimelineScroller from "~/components/timelines/timeline-scroller.vue";
|
||||
|
||||
definePageMeta({
|
||||
layout: "app",
|
||||
});
|
||||
</script>
|
||||
|
|
@ -6,15 +6,18 @@
|
|||
<div class="grid grid-cols-1 2xl:grid-cols-2 gap-4 mt-6">
|
||||
<template v-for="[id, setting] of settingEntries">
|
||||
<SwitchPreference v-if="setting.type === SettingType.Boolean" :setting="(setting as BooleanSetting)" @update:setting="updateSetting(id, setting)" />
|
||||
<SelectPreference v-else-if="setting.type === SettingType.Enum" :setting="(setting as EnumSetting)" @update:setting="updateSetting(id, setting)" />
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import SelectPreference from "~/components/preferences/select.vue";
|
||||
import SwitchPreference from "~/components/preferences/switch.vue";
|
||||
import {
|
||||
type BooleanSetting,
|
||||
type EnumSetting,
|
||||
type Setting,
|
||||
type SettingIds,
|
||||
type SettingPages,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue