fix repetitive save of WorkoutItem, add: Onboarding, Defaults, Settings, Trainer/Trainee skeletons, reorder files, remove all Bindable
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user