add apple tv app
This commit is contained in:
71
iphone/Werkout_ios/subview/WorkoutOverviewView.swift
Normal file
71
iphone/Werkout_ios/subview/WorkoutOverviewView.swift
Normal file
@@ -0,0 +1,71 @@
|
||||
//
|
||||
// WorkoutOverviewView.swift
|
||||
// Werkout_ios
|
||||
//
|
||||
// Created by Trey Tartt on 7/9/23.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct WorkoutOverviewView: View {
|
||||
let workout: Workout
|
||||
var body: some View {
|
||||
VStack {
|
||||
HStack {
|
||||
VStack {
|
||||
Text(workout.name)
|
||||
.font(.title2)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
|
||||
Text(workout.description ?? "")
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
|
||||
if let estimatedTime = workout.estimatedTime {
|
||||
Text("Time: " + estimatedTime.asString(style: .abbreviated))
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
}
|
||||
|
||||
if let createdAt = workout.createdAt {
|
||||
Text(createdAt, style: .date)
|
||||
.font(.footnote)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
}
|
||||
}
|
||||
if let exerciseCount = workout.exercise_count {
|
||||
VStack {
|
||||
Text("\(exerciseCount)")
|
||||
.font(.body.bold())
|
||||
Text("exercises")
|
||||
.font(.footnote)
|
||||
.foregroundColor(Color(uiColor: .systemGray2))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if let muscles = workout.muscles,
|
||||
muscles.joined(separator: ", ").count > 0{
|
||||
Divider()
|
||||
Text(muscles.joined(separator: ", "))
|
||||
.font(.footnote)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
}
|
||||
|
||||
if let equipment = workout.equipment,
|
||||
equipment.joined(separator: ", ").count > 0 {
|
||||
Divider()
|
||||
Text(equipment.joined(separator: ", "))
|
||||
.font(.footnote)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
}
|
||||
}
|
||||
.padding()
|
||||
.background(Color(uiColor: .secondarySystemBackground))
|
||||
.cornerRadius(15)
|
||||
}
|
||||
}
|
||||
|
||||
struct WorkoutOverviewView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
WorkoutOverviewView(workout: PreviewData.allWorkouts()[2])
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user