Skip to content

Commit 6b72a78

Browse files
authored
Merge pull request #1 from quickpose/feature/pete-tidyup
tidy up
2 parents 3cb4239 + a75c17d commit 6b72a78

File tree

19 files changed

+275
-709
lines changed

19 files changed

+275
-709
lines changed

FitCount.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 0 additions & 4 deletions
This file was deleted.

FitCount/Assets.xcassets/AccentColor.colorset/Contents.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"colors" : [
33
{
4+
"color" : {
5+
"platform" : "universal",
6+
"reference" : "systemIndigoColor"
7+
},
48
"idiom" : "universal"
59
}
610
],

FitCount/ContentView.swift

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@ class SessionConfig: ObservableObject {
1212
@Published var nReps : Int = 1
1313
@Published var nMinutes : Int = 0
1414
@Published var nSeconds : Int = 1
15-
1615
@Published var useReps: Bool = true
1716
@Published var exercise: Exercise = exercises[0] // use first exercise by default but change in the ExerciseDetailsView
1817
}
1918

2019
struct ContentView: View {
2120
@StateObject var viewModel = ViewModel()
22-
@StateObject var sessionConfig: SessionConfig = SessionConfig()
23-
21+
@StateObject var sessionConfig = SessionConfig()
2422

2523
var body: some View {
2624
NavigationStack(path: $viewModel.path) {
@@ -34,9 +32,11 @@ struct ContentView: View {
3432
.font(.headline)
3533
}
3634
.padding()
37-
.cornerRadius(8) // Add corner radius for a rounded look
35+
.cornerRadius(8)
3836
}.navigationDestination(for: Exercise.self) { exercise in
39-
ExerciseDetailsView(exercise: exercise).environmentObject(viewModel).environmentObject(sessionConfig)
37+
ExerciseDetailsView(exercise: exercise)
38+
.environmentObject(viewModel)
39+
.environmentObject(sessionConfig)
4040
}
4141
}
4242
.background(.white)
@@ -60,13 +60,9 @@ struct ContentView: View {
6060

6161

6262
class ViewModel: ObservableObject {
63-
@Published var path: NavigationPath = NavigationPath()
64-
}
65-
66-
struct ContentView_Previews: PreviewProvider {
67-
static var previews: some View {
68-
ContentView()
63+
@Published var path = NavigationPath()
64+
65+
func popToRoot(){
66+
path.removeLast(path.count) // pop to root
6967
}
7068
}
71-
72-

FitCount/FitCountApp.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ struct Exercise: Identifiable, Hashable {
1919

2020
let exercises = [
2121
Exercise(
22-
name: "Biceps Curls",
22+
name: "Bicep Curls",
2323
details: "Lift weights in both hands by bending your elbow and lifting them towards your shoulder.",
24-
features: [.fitness(.bicepsCurls), .overlay(.upperBody)]
24+
features: [.fitness(.bicepCurls), .overlay(.upperBody)]
2525
),
2626
Exercise(
2727
name: "Squats",

FitCount/History/HistoryView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ struct HistoryView: View {
2525
Text(sessionData.exercise)
2626
.font(.title)
2727
.fontWeight(.bold)
28-
.foregroundColor(.indigo)
28+
.foregroundColor(Color("AccentColor"))
2929

3030
Text(sessionData.date.formatted(
3131
.dateTime

FitCount/Preview Content/Preview Assets.xcassets/Contents.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

FitCount/Workout/BoundingBoxView.swift

Lines changed: 0 additions & 42 deletions
This file was deleted.

FitCount/Workout/ExerciseDetailsView.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import SwiftUI
99
import PagerTabStripView
1010

11-
1211
struct TitleNavBarItem: View {
1312
let title: String
1413

@@ -36,7 +35,6 @@ struct ExerciseDetailsView: View {
3635
.font(.body)
3736
.padding()
3837

39-
4038
Spacer()
4139

4240
PagerTabStripView(
@@ -117,8 +115,8 @@ struct ExerciseDetailsView: View {
117115
Text("Start workout")
118116
.foregroundColor(.white)
119117
.padding()
120-
.background(.indigo) // Set background color to the main color
121-
.cornerRadius(8) // Add corner radius for a rounded look
118+
.background(Color("AccentColor"))
119+
.cornerRadius(8)
122120

123121
}
124122
.navigationDestination(for: String.self) { _ in

FitCount/Workout/InstructionsView.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,3 @@ struct InstructionsView: View {
3131

3232
}
3333
}
34-
35-
struct InstructionsView_Previews: PreviewProvider {
36-
static var previews: some View {
37-
InstructionsView()
38-
}
39-
}

0 commit comments

Comments
 (0)