Skip to content

Commit

Permalink
UI changes for clarity on steps setting page. It's ugly but it's clea…
Browse files Browse the repository at this point in the history
…r what to do.
  • Loading branch information
xan-m committed Nov 11, 2021
1 parent b545da0 commit 81f20a5
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 81 deletions.
70 changes: 0 additions & 70 deletions InfiniLink/View Components/Sheets/StepsSettingsSheet.swift

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ struct StepSettingsSheetDatePicker: View {

var body: some View {
Text("Manually Add Step Count")
.font(.title)
.font(.title2)
.padding()
DatePicker("Select Date", selection: $selectedDate, displayedComponents: [.date])
.padding()
TextField("Number of Steps", text: $addDateValue.value)
TextField("Enter Number of Steps", text: $addDateValue.value)
.textFieldStyle(.roundedBorder)
.padding()
.keyboardType(.decimalPad)
.keyboardType(.numberPad)
Button {
StepCountPersistenceManager().setStepCount(steps: Int(addDateValue.value)!, arbitrary: true, date: selectedDate)
} label: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ struct StepSettingsSheetGoalChange: View {

var body: some View {
Text("Change Step Count Goal")
.font(.title)
.font(.title2)
.padding()
TextField("Step Goal", text: $setStepGoal.value)
TextField("Enter Step Goal", text: $setStepGoal.value)
.textFieldStyle(.roundedBorder)
.padding()
.keyboardType(.decimalPad)
.keyboardType(.numberPad)
Button {
stepCountGoal = Int(setStepGoal.value)!
} label: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,29 @@
import SwiftUI

struct StepSettingsSheet: View {
@State var pickerState = 0

var body: some View {
VStack (alignment: .leading) {
SheetCloseButton()
Text("Step Count Settings")
Text("Steps Settings")
.font(.largeTitle)
.padding()
.padding(.bottom, 20)
StepSettingsSheetGoalChange()
Divider()
.padding()
StepSettingsSheetDatePicker()
Picker("", selection: $pickerState) {
Text("Step Goal").tag(0)
Text("Add Steps").tag(1)
}.pickerStyle(.segmented)
.padding(.bottom)
.padding(.horizontal)
switch pickerState {
case 0:
StepSettingsSheetGoalChange()
case 1:
StepSettingsSheetDatePicker()
default:
EmptyView()
}
Spacer()
}
}
Expand Down

0 comments on commit 81f20a5

Please sign in to comment.