You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DouShouQi_App/DouShouQi_App/DouShouQi_App/Views/Menu/SettingsView.swift

77 lines
1.9 KiB

//
// SettingsView.swift
// DouShouQi_App
//
// Created by etudiant on 27/05/2024.
//
import SwiftUI
extension String : Identifiable {
public var id: Self { return self }
}
struct SettingsView: View {
@State private var theme = false
@State private var choice = "English"
@State private var sound = true
var body: some View {
VStack {
TitlePageFrame(Text: "Settings")
VStack {
Divider()
HStack {
Text("Theme")
.font(.headline)
Spacer()
CustomSwitchButton(IsOn: $theme, imgSystemNameIsOff: "sun.max", imgSystemNameIsOn: "moon")
}
Divider()
HStack {
Text("Language")
.font(.headline)
Spacer()
Picker("Sort", selection: $choice) {
ForEach(["English", "Français", "Español"]) {
Text($0)
}
}
.pickerStyle(.menu)
}
Divider()
HStack {
Text("Theme")
.font(.headline)
Spacer()
CustomSwitchButton(IsOn: $sound, imgSystemNameIsOff: "speaker.slash", imgSystemNameIsOn: "speaker.2")
}
Divider()
}
.padding(20)
Spacer()
}
}
}
struct SettingsView_Previews: PreviewProvider {
static var previews: some View {
SettingsView()
}
}