clean up ActiveWorkoutSession
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
//
|
||||
// Created by Felix Förtsch on 12.09.24.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import SwiftData
|
||||
|
||||
@@ -15,22 +16,21 @@ struct ActiveWorkoutSession: View {
|
||||
|
||||
var body: some View {
|
||||
VStack {
|
||||
VStack {
|
||||
Text(activeWorkoutSession.name)
|
||||
SimpleStopWatch(
|
||||
startDate: activeWorkoutSession.startDate,
|
||||
duration: $activeWorkoutSession.workoutDuration)
|
||||
.font(.system(.largeTitle, design: .monospaced))
|
||||
.fontWeight(.bold)
|
||||
}
|
||||
List {
|
||||
Section(header: Text("Exercises")) {
|
||||
ForEach(activeWorkoutSession.workoutSessionItems) { workoutItem in
|
||||
ActiveWorkoutSessionListItem(workoutItem: workoutItem)
|
||||
Section {
|
||||
ForEach(activeWorkoutSession.workoutSessionItems.reversed()) { workoutSessionItem in
|
||||
ActiveWorkoutSessionListItem(workoutSessionItem: workoutSessionItem)
|
||||
}
|
||||
}
|
||||
}.listStyle(.plain)
|
||||
|
||||
VStack {
|
||||
Text(activeWorkoutSession.name)
|
||||
ActiveWorkoutSessionControls(session: $activeWorkoutSession)
|
||||
}
|
||||
.frame(height: 200)
|
||||
}
|
||||
.background(.bar)
|
||||
// .navigationTitle(activeWorkoutSession.name)
|
||||
// .navigationBarTitleDisplayMode(.inline)
|
||||
.toolbar {
|
||||
|
||||
Reference in New Issue
Block a user