Skip to content

Commit

Permalink
Reorganize settings switches
Browse files Browse the repository at this point in the history
  • Loading branch information
PetJer committed Nov 17, 2024
1 parent b990d69 commit cd3f1cb
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
4 changes: 2 additions & 2 deletions website/src/components/SettingsBaseSwitch.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<script setup lang="ts">
const checked = defineModel<boolean>()
defineProps<{ label: string }>()
defineProps<{ label: string; icon?: string }>()
</script>

<template>
<v-row>
<v-col>
<v-switch v-model="checked" class="settings-base-switch">
<v-switch v-model="checked" :true-icon="icon" :false-icon="icon" class="settings-base-switch">
<template #label>{{ label }}</template>
</v-switch>
</v-col>
Expand Down
5 changes: 3 additions & 2 deletions website/src/stores/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ export const useSettingsStore = defineStore('settings', {

showSubstitutions: true,
showLinksInTimetable: true,
showDatesInTimetable: true,
showHoursInTimetable: true,
highlightCurrentTime: true,
enableLessonDetails: true,

showDatesInTimetable: true,
showHoursInTimetable: true,
enablePullToRefresh: true,

dataCollectionPerformance: navigator.doNotTrack !== '1' && !navigator.globalPrivacyControl,
Expand Down
23 changes: 20 additions & 3 deletions website/src/views/ViewSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import {
mdiInformationOutline,
mdiKeyOutline,
mdiMessageAlertOutline,
mdiMonitor,
mdiPaletteOutline,
mdiTabletCellphone,
mdiTuneVariant,
mdiUpdate,
mdiWeatherNight,
Expand Down Expand Up @@ -100,11 +102,26 @@ async function updateApp() {

<SettingsBaseSwitch v-model="showSubstitutions" label="Prikaži nadomeščanja" />
<SettingsBaseSwitch v-model="showLinksInTimetable" label="Prikaži povezave v urniku" />
<SettingsBaseSwitch v-model="showDatesInTimetable" label="Prikaži datume v urniku" />
<SettingsBaseSwitch v-model="showHoursInTimetable" label="Prikaži ure v urniku" />
<SettingsBaseSwitch v-model="highlightCurrentTime" label="Označi trenutno uro" />
<SettingsBaseSwitch v-model="enableLessonDetails" label="Klikni za podrobnosti" />
<SettingsBaseSwitch v-model="enablePullToRefresh" label="Potegni za posodobitev" />

<v-divider-settings />

<SettingsBaseSwitch
v-model="showDatesInTimetable"
label="Prikaži datume v urniku"
:icon="mdiMonitor"
/>
<SettingsBaseSwitch
v-model="showHoursInTimetable"
label="Prikaži ure v urniku"
:icon="mdiMonitor"
/>
<SettingsBaseSwitch
v-model="enablePullToRefresh"
label="Potegni za posodobitev"
:icon="mdiTabletCellphone"
/>

<v-divider-settings />

Expand Down

0 comments on commit cd3f1cb

Please sign in to comment.