code organization
This commit is contained in:
31
Werkout_ios/subview/CountdownView.swift
Normal file
31
Werkout_ios/subview/CountdownView.swift
Normal file
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// CountdownView.swift
|
||||
// Werkout_ios
|
||||
//
|
||||
// Created by Trey Tartt on 7/7/23.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct CountdownView: View {
|
||||
@StateObject var bridgeModule = BridgeModule.shared
|
||||
|
||||
var body: some View {
|
||||
if let duration = bridgeModule.currentExerciseInfo.currentExercise?.duration,
|
||||
duration > 0 {
|
||||
HStack {
|
||||
if bridgeModule.currentExerciseTimeLeft >= 0 && duration > bridgeModule.currentExerciseTimeLeft {
|
||||
ProgressView(value: Float(bridgeModule.currentExerciseTimeLeft), total: Float(duration))
|
||||
Text("\(bridgeModule.currentExerciseTimeLeft)")
|
||||
.font(.body)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct CountdownView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
CountdownView()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user