Skip to content

Commit

Permalink
trying again
Browse files Browse the repository at this point in the history
  • Loading branch information
zoyagarg committed Mar 12, 2024
1 parent 08079fc commit 38ee20c
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 59 deletions.
106 changes: 53 additions & 53 deletions Intake/ScrollablePDF.swift
Original file line number Diff line number Diff line change
Expand Up @@ -239,62 +239,62 @@ struct ScrollablePDF: View {
}

private struct MenstrualSection: View {
@Environment(DataStore.self) private var data
@Environment(DataStore.self) private var data

var body: some View {
Section(header: Text("Menstrual History")) {
VStack(alignment: .leading) {
HStack {
Text("Start Date:")
Spacer()
Text(data.menstrualHistory.startDate, style: .date)
.foregroundColor(.secondary)
}
HStack {
Text("End Date:")
Spacer()
Text(data.menstrualHistory.endDate, style: .date)
.foregroundColor(.secondary)
}
HStack {
Text("Additional Details:")
Spacer()
Text(data.menstrualHistory.additionalDetails)
.foregroundColor(.secondary)
}
}
}
}
}
var body: some View {
Section(header: Text("Menstrual History")) {
VStack(alignment: .leading) {
HStack {
Text("Start Date:")
Spacer()
Text(data.menstrualHistory.startDate, style: .date)
.foregroundColor(.secondary)
}
HStack {
Text("End Date:")
Spacer()
Text(data.menstrualHistory.endDate, style: .date)
.foregroundColor(.secondary)
}
HStack {
Text("Additional Details:")
Spacer()
Text(data.menstrualHistory.additionalDetails)
.foregroundColor(.secondary)
}
}
}
}

Check warning on line 267 in Intake/ScrollablePDF.swift

View check run for this annotation

Codecov / codecov/patch

Intake/ScrollablePDF.swift#L244-L267

Added lines #L244 - L267 were not covered by tests
}

private struct SmokingSection: View {
@Environment(DataStore.self) private var data
private struct SmokingSection: View {
@Environment(DataStore.self) private var data

var body: some View {
Section(header: Text("Smoking History")) {
VStack(alignment: .leading) {
HStack {
Text("Currently Smoking:")
Spacer()
Text(data.smokingHistory.currentlySmoking ? "Yes" : "No")
.foregroundColor(.secondary)
}
HStack {
Text("Smoked in the Past:")
Spacer()
Text(data.smokingHistory.smokedInThePast ? "Yes" : "No")
.foregroundColor(.secondary)
}
HStack {
Text("Additional Details:")
Spacer()
Text(data.smokingHistory.additionalDetails)
.foregroundColor(.secondary)
}
}
}
}
}
var body: some View {
Section(header: Text("Smoking History")) {
VStack(alignment: .leading) {
HStack {
Text("Currently Smoking:")
Spacer()
Text(data.smokingHistory.currentlySmoking ? "Yes" : "No")
.foregroundColor(.secondary)
}
HStack {
Text("Smoked in the Past:")
Spacer()
Text(data.smokingHistory.smokedInThePast ? "Yes" : "No")
.foregroundColor(.secondary)
}
HStack {
Text("Additional Details:")
Spacer()
Text(data.smokingHistory.additionalDetails)
.foregroundColor(.secondary)
}
}
}
}

Check warning on line 296 in Intake/ScrollablePDF.swift

View check run for this annotation

Codecov / codecov/patch

Intake/ScrollablePDF.swift#L273-L296

Added lines #L273 - L296 were not covered by tests
}

@Environment(DataStore.self) private var data
@Environment(NavigationPathWrapper.self) private var navigationPath
Expand Down
11 changes: 5 additions & 6 deletions Intake/SocialHistory/SmokingHistory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
import SwiftUI

struct SmokingHistoryView: View {
@State private var hasSmokedOrSmoking: Bool = false
@State private var currentlySmoking: Bool = false
@State private var smokedInThePast: Bool = false
@State private var hasSmokedOrSmoking = false
@State private var currentlySmoking = false
@State private var smokedInThePast = false

Check warning on line 18 in Intake/SocialHistory/SmokingHistory.swift

View check run for this annotation

Codecov / codecov/patch

Intake/SocialHistory/SmokingHistory.swift#L16-L18

Added lines #L16 - L18 were not covered by tests
@State private var additionalDetails: String = ""
@Environment(DataStore.self) private var data
@Environment(NavigationPathWrapper.self) private var navigationPath // Ensure you have this environment object
Expand All @@ -36,16 +36,15 @@ struct SmokingHistoryView: View {
.onDisappear {
storeSmokingHistory()

Check warning on line 37 in Intake/SocialHistory/SmokingHistory.swift

View check run for this annotation

Codecov / codecov/patch

Intake/SocialHistory/SmokingHistory.swift#L37

Added line #L37 was not covered by tests
}
// Placing SubmitButton here ensures it appears at the bottom
SubmitButton(nextView: NavigationViews.pdfs)
SubmitButton(nextView: NavigationViews.chat)
.padding()
}
}
}

private var initialSmokingQuestionSection: some View {
Section(header: Text("Smoking Status").foregroundColor(.gray)) {
Toggle("Have you smoked or are you currently smoking?", isOn: $hasSmokedOrSmoking)
Toggle("Are you currently smoking or have you smoked in the past?", isOn: $hasSmokedOrSmoking)

Check warning on line 47 in Intake/SocialHistory/SmokingHistory.swift

View check run for this annotation

Codecov / codecov/patch

Intake/SocialHistory/SmokingHistory.swift#L45-L47

Added lines #L45 - L47 were not covered by tests
}
}

Expand Down

0 comments on commit 38ee20c

Please sign in to comment.