split views into subview
This commit is contained in:
33
iphone/Werkout_ios/subview/WorkoutInfoView.swift
Normal file
33
iphone/Werkout_ios/subview/WorkoutInfoView.swift
Normal file
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// WorkoutInfoView.swift
|
||||
// Werkout_ios
|
||||
//
|
||||
// Created by Trey Tartt on 6/18/24.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct WorkoutInfoView: View {
|
||||
let workout: Workout
|
||||
|
||||
var body: some View {
|
||||
VStack {
|
||||
Text(workout.name)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.font(.title3)
|
||||
.padding(.top
|
||||
)
|
||||
if let desc = workout.description {
|
||||
Text(desc)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.font(.body)
|
||||
.padding(.top)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//#Preview {
|
||||
// WorkoutInfoView()
|
||||
//}
|
||||
Reference in New Issue
Block a user