From 5dc136372b2a4db02cb78504024ca2123ca4790a Mon Sep 17 00:00:00 2001 From: Phojie Rengel <33350692+Phojie@users.noreply.github.com> Date: Fri, 28 Apr 2023 15:42:23 +0800 Subject: [PATCH] refactor: button creation with v-for to remove redundancy (#2020) --- components/settings/SettingsColorMode.vue | 48 ++++++++++++----------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/components/settings/SettingsColorMode.vue b/components/settings/SettingsColorMode.vue index 3bb99568..823f835d 100644 --- a/components/settings/SettingsColorMode.vue +++ b/components/settings/SettingsColorMode.vue @@ -6,36 +6,38 @@ const colorMode = useColorMode() function setColorMode(mode: ColorMode) { colorMode.preference = mode } + +const modes = [ + { + icon: 'i-ri-moon-line', + label: 'settings.interface.dark_mode', + mode: 'dark', + }, + { + icon: 'i-ri-sun-line', + label: 'settings.interface.light_mode', + mode: 'light', + }, + { + icon: 'i-ri-computer-line', + label: 'settings.interface.system_mode', + mode: 'system', + }, +] as const