-
Notifications
You must be signed in to change notification settings - Fork 0
/
FinishPopUp.swift
94 lines (65 loc) · 2.76 KB
/
FinishPopUp.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
//
// FinishPopUp.swift
// NutrimalA
//
// Created by Shawn Wakeman on 5/10/23.
//
import SwiftUI
struct FinishPopUp: View {
@State private var time: Double = 0
@State private var isToggled = false
@ObservedObject var homePageViewModel: HomePageViewModel
@ObservedObject var timeViewModel: TimeViewModel
@ObservedObject var viewModel: WorkoutLogViewModel
@State private var radomeState = false
var body: some View {
VStack {
HStack {
TextHelvetica(content: "Workout Completed", size: 27)
.foregroundColor(Color("WhiteFontOne"))
Spacer()
Button {
HapticManager.instance.impact(style: .rigid)
timeViewModel.setWorkoutTime(time: 0)
withAnimation(.spring()) {
homePageViewModel.setOngoingState(state: false)
homePageViewModel.setWorkoutLogModuleStatus(state: false)
}
homePageViewModel.saveExersiseHistory()
viewModel.resetWorkoutModel()
cancelNotifications()
}
label: {
ZStack {
RoundedRectangle(cornerRadius: 4)
.overlay(
RoundedRectangle(cornerRadius: 4)
.stroke(Color("BorderGray"), lineWidth: borderWeight))
.foregroundColor(Color("MainGray"))
Image("checkMark")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 17, height: 17)
}
}.frame(width: 50, height: 30)
}
.padding(.top, -2)
.padding(.horizontal)
.padding(.vertical, 10)
Spacer()
TextHelvetica(content: "Good Job", size: 20)
.foregroundColor(Color(.clear))
if let workout = homePageViewModel.history.last {
ExpandedHistory(workout: workout, viewModel: homePageViewModel, showingExpandedExercise: $radomeState , isforFinish: true)
}
Spacer()
}
.frame(height: getScreenBounds().height * 0.7)
.background(Color("DBblack"))
.cornerRadius(10)
.overlay(
RoundedRectangle(cornerRadius: 10)
.stroke(Color("BorderGray"), lineWidth: borderWeight))
.padding(.all)
}
}