add ActiveWorkoutSession logic, refactor Home, add additional sample data, add isDebug
This commit is contained in:
@@ -7,30 +7,42 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
// TODO: Import/Export Workouts/Exercises
|
||||
// https://www.avanderlee.com/swift/json-parsing-decoding/
|
||||
struct Settings: View {
|
||||
@Default(\.isDebug) var isDebug
|
||||
@Default(\.isFirstAppStart) var isFirstAppStart
|
||||
@Default(\.isOnboarding) var isOnboarding
|
||||
@Default(\.isTrainerMode) var isTrainerMode
|
||||
@Default(\.userId) var userId
|
||||
@Default(\.reps) var reps
|
||||
|
||||
var body: some View {
|
||||
List {
|
||||
Section(header: Text("User")) {
|
||||
Section(
|
||||
header: Text("User"),
|
||||
footer: Text("Trainer Mode enables you to add and manage trainees.")) {
|
||||
Text(userId)
|
||||
TextField("name", text: $userId)
|
||||
Toggle(isOn: $isTrainerMode) {
|
||||
Text("Trainer Mode")
|
||||
}
|
||||
}
|
||||
Section(header: Text("Defaults")) {
|
||||
StepperListItem(itemName: "Rep Count", itemValue: $reps)
|
||||
}
|
||||
Text(String(reps))
|
||||
Section(header: Text("Danger Zone")) {
|
||||
|
||||
Toggle(isOn: $isDebug) {
|
||||
Text("isDebug")
|
||||
}
|
||||
Toggle(isOn: $isOnboarding) {
|
||||
Text("isOnboarding")
|
||||
Text("isOnboarding ")
|
||||
}
|
||||
Button("Reset App", role: .destructive, action: resetApp)
|
||||
}
|
||||
}
|
||||
.navigationTitle("Settings")
|
||||
}
|
||||
|
||||
private func resetApp() {
|
||||
@@ -40,5 +52,7 @@ struct Settings: View {
|
||||
}
|
||||
|
||||
#Preview {
|
||||
Settings()
|
||||
NavigationStack {
|
||||
Settings()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user