Skip to content

Commit 4889f48

Browse files
committed
history page design
1 parent e3ba7f7 commit 4889f48

File tree

2 files changed

+48
-22
lines changed

2 files changed

+48
-22
lines changed

FitCount/History/HistoryView.swift

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,52 @@ struct HistoryView: View {
2020
if let sessionDataArray = sessionDataArray {
2121
ScrollView {
2222
ForEach(sessionDataArray.reversed(), id: \.self) { sessionData in
23-
Text(sessionData.exercise)
24-
Text("\(sessionData.count) reps")
25-
Text("\(sessionData.seconds) sec")
26-
Text(sessionData.date.formatted(
27-
.dateTime
28-
.day(.defaultDigits)
29-
.month(.abbreviated)
30-
.year(.defaultDigits)
31-
))
23+
HStack(spacing: 16) {
24+
VStack(alignment: .leading, spacing: 8) {
25+
Text(sessionData.exercise)
26+
.font(.title)
27+
.fontWeight(.bold)
28+
.foregroundColor(.indigo)
29+
30+
Text(sessionData.date.formatted(
31+
.dateTime
32+
.day(.defaultDigits)
33+
.month(.abbreviated)
34+
.year(.defaultDigits)
35+
))
36+
.font(.subheadline)
37+
.foregroundColor(.gray)
38+
}
39+
40+
Spacer()
41+
42+
VStack(alignment: .trailing, spacing: 8) {
43+
Text("\(sessionData.count) reps")
44+
.font(.title2)
45+
46+
Text("\(sessionData.seconds) sec")
47+
.font(.title2)
48+
49+
50+
}
51+
}
52+
53+
.padding(.vertical, 12)
54+
.padding(.horizontal, 16)
55+
.cornerRadius(8)
3256
Divider()
3357
}
3458
}
35-
.padding(10)
59+
.padding(.horizontal, 16)
3660
} else {
3761
Text("No data to display.")
62+
.font(.title2)
63+
.fontWeight(.bold)
64+
.padding(16)
3865
}
39-
}.navigationBarTitle("History")
66+
}
67+
.navigationBarTitle("History")
4068
}
69+
4170
}
4271
}
43-
44-
//struct HistoryView_Previews: PreviewProvider {
45-
// static var previews: some View {
46-
// HistoryView()
47-
// }
48-
//}

FitCount/Workout/WorkoutResultsView.swift

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@ struct WorkoutResultsView: View {
1313

1414
var body: some View {
1515
NavigationView{
16-
VStack() {
16+
VStack(spacing: 20) {
17+
Text("Your workour results")
18+
.font(.largeTitle)
19+
.padding(.top, 50)
20+
1721
Text("Number of reps: \(sessionData.count)")
18-
.font(.title)
22+
.font(.title2)
1923
.padding(.top, 50)
2024
.padding(.bottom, 20)
2125

@@ -39,11 +43,10 @@ struct WorkoutResultsView: View {
3943

4044
Spacer()
4145
}
42-
.navigationBarTitle("Results")
4346
.navigationBarBackButtonHidden(true)
47+
// .navigationBarTitle("Results")
4448
.padding()
45-
.background(Color.white) // Set the background color of the entire view
46-
// .padding([.leading, .trailing], 24)
49+
.background(Color.white)
4750
}
4851
}
4952
}

0 commit comments

Comments
 (0)