fix repetitive save of WorkoutItem, add: Onboarding, Defaults, Settings, Trainer/Trainee skeletons, reorder files, remove all Bindable

This commit is contained in:
Felix Förtsch
2024-09-04 18:44:28 +02:00
parent 0905ea7d3f
commit d82d0cd9fa
25 changed files with 426 additions and 134 deletions
@@ -0,0 +1,43 @@
//
// StepperListItem.swift
// WorkoutsPlus
//
// Created by Felix Förtsch on 04.09.24.
//
import SwiftUI
struct StepperListItem: View {
@State var itemName: String
@Binding var itemValue: Int
var body: some View {
Stepper(
value: $itemValue,
in: 0...100,
step: 1
) {
HStack {
Text(String(itemValue))
.font(.system(size: 14, weight: .bold))
.foregroundStyle(.white)
.frame(width: 20, height: 10)
.padding(8)
.background(Color.blue)
.clipShape(RoundedRectangle(cornerRadius: 8))
Text(itemName)
.foregroundStyle(.black)
}
}
}
}
#Preview {
@Previewable @State var value = 8
List {
StepperListItem(itemName: "Short Name", itemValue: $value)
StepperListItem(itemName: "Very very very very long name with whitespace", itemValue: $value)
StepperListItem(itemName: "Veryveryverylonglonglonglongnamewithoutwithwhitespace", itemValue: $value)
}
}