From 4bc2b427aa28d4b5bd7859ebbb8e74b1a7be090b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Regnault?= Date: Tue, 28 May 2024 17:01:35 +0200 Subject: [PATCH] :sparkles: adding SystemIcons struct to contains name of system images --- .../DouShouQi_App/Assets/Images/SystemIcons.swift | 15 +++++++++++++++ .../DouShouQi_App/Views/Menu/SettingsView.swift | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 DouShouQi_App/DouShouQi_App/Assets/Images/SystemIcons.swift diff --git a/DouShouQi_App/DouShouQi_App/Assets/Images/SystemIcons.swift b/DouShouQi_App/DouShouQi_App/Assets/Images/SystemIcons.swift new file mode 100644 index 0000000..c948321 --- /dev/null +++ b/DouShouQi_App/DouShouQi_App/Assets/Images/SystemIcons.swift @@ -0,0 +1,15 @@ +// +// SystemIcons.swift +// DouShouQi_App +// +// Created by Rémi REGNAULT on 28/05/2024. +// + +import Foundation + +public struct SystemIcons { + static let DarkTheme = "moon" + static let LightTheme = "sun.max" + static let SoundOn = "speaker.2" + static let SoundOff = "speaker.slash" +} diff --git a/DouShouQi_App/DouShouQi_App/Views/Menu/SettingsView.swift b/DouShouQi_App/DouShouQi_App/Views/Menu/SettingsView.swift index dd90ddc..dcdb387 100644 --- a/DouShouQi_App/DouShouQi_App/Views/Menu/SettingsView.swift +++ b/DouShouQi_App/DouShouQi_App/Views/Menu/SettingsView.swift @@ -30,7 +30,7 @@ struct SettingsView: View { Spacer() - CustomSwitchButton(IsOn: $theme, imgSystemNameIsOff: "sun.max", imgSystemNameIsOn: "moon") + CustomSwitchButton(IsOn: $theme, imgSystemNameIsOff: SystemIcons.LightTheme, imgSystemNameIsOn: SystemIcons.DarkTheme) } Divider() @@ -57,7 +57,7 @@ struct SettingsView: View { Spacer() - CustomSwitchButton(IsOn: $sound, imgSystemNameIsOff: "speaker.slash", imgSystemNameIsOn: "speaker.2") + CustomSwitchButton(IsOn: $sound, imgSystemNameIsOff: SystemIcons.SoundOff, imgSystemNameIsOn: SystemIcons.SoundOn) } Divider()