complete account view sub views
This commit is contained in:
@@ -12,8 +12,9 @@ struct CompletedWorkoutsView: View {
|
|||||||
@State var showCompletedWorkouts: Bool = false
|
@State var showCompletedWorkouts: Bool = false
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
if let completedWorkouts = completedWorkouts {
|
VStack(alignment: .leading) {
|
||||||
VStack(alignment: .leading) {
|
if let completedWorkouts = completedWorkouts {
|
||||||
|
|
||||||
Divider()
|
Divider()
|
||||||
Text("Workout History:")
|
Text("Workout History:")
|
||||||
HStack {
|
HStack {
|
||||||
@@ -39,14 +40,16 @@ struct CompletedWorkoutsView: View {
|
|||||||
.frame(maxWidth: .infinity)
|
.frame(maxWidth: .infinity)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Text("loading completed workouts")
|
||||||
}
|
}
|
||||||
.onAppear{
|
}
|
||||||
fetchCompletedWorkouts()
|
.onAppear{
|
||||||
}
|
fetchCompletedWorkouts()
|
||||||
.sheet(isPresented: $showCompletedWorkouts) {
|
}
|
||||||
if completedWorkouts.count > 0 {
|
.sheet(isPresented: $showCompletedWorkouts) {
|
||||||
WorkoutHistoryView(completedWorkouts: completedWorkouts)
|
if let completedWorkouts = completedWorkouts {
|
||||||
}
|
WorkoutHistoryView(completedWorkouts: completedWorkouts)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user