File tree Expand file tree Collapse file tree 2 files changed +5
-26
lines changed
Expand file tree Collapse file tree 2 files changed +5
-26
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ public struct ActionButtonStyle: ButtonStyle {
2222 private let cornerRadius : CGFloat = 10
2323 private let squidge : CGFloat = 1
2424
25+ @Environment ( \. isEnabled) private var isEnabled : Bool
26+
2527 public init ( _ style: ButtonType = . primary) {
2628 switch style {
2729 case . primary:
@@ -46,7 +48,7 @@ public struct ActionButtonStyle: ButtonStyle {
4648 . foregroundColor ( fontColor)
4749 . font ( . headline)
4850 . frame ( maxWidth: . infinity)
49- . background ( backgroundColor)
51+ . background ( isEnabled ? backgroundColor : Color ( UIColor . lightGray ) )
5052 . overlay ( Color ( . secondarySystemBackground) . opacity ( configuration. isPressed ? 0.35 : 0 ) )
5153 . cornerRadius ( cornerRadius)
5254 . padding ( configuration. isPressed ? squidge : 0 )
Original file line number Diff line number Diff line change @@ -41,20 +41,13 @@ public struct TherapySettingsView: View {
4141 }
4242
4343 public var body : some View {
44- switch mode {
45- case . acceptanceFlow:
46- content
47- case . settings:
48- navigationViewWrappedContent
49- }
44+ content
5045 }
5146
5247 private var content : some View {
53- CardList ( title: cardListTitle , style: . sectioned( cardListSections) , trailer: cardListTrailer)
48+ CardList ( title: Text ( therapySettingsTitle ) , style: . sectioned( cardListSections) , trailer: cardListTrailer)
5449 }
5550
56- private var cardListTitle : Text ? { mode == . acceptanceFlow ? Text ( therapySettingsTitle) : nil }
57-
5851 private var therapySettingsTitle : String {
5952 return LocalizedString ( " Therapy Settings " , comment: " Therapy Settings screen title " )
6053 }
@@ -110,22 +103,6 @@ public struct TherapySettingsView: View {
110103 }
111104 }
112105
113- private var navigationViewWrappedContent : some View {
114- NavigationView {
115- ZStack {
116- Color ( . systemGroupedBackground)
117- . edgesIgnoringSafeArea ( . all)
118- content
119- . toolbar {
120- ToolbarItem ( placement: . navigationBarTrailing) {
121- dismissButton
122- }
123- }
124- . navigationBarTitle ( therapySettingsTitle, displayMode: . large)
125- }
126- }
127- }
128-
129106 private var dismissButton : some View {
130107 Button ( action: dismissAction) {
131108 Text ( LocalizedString ( " Done " , comment: " Text for dismiss button " ) )
You can’t perform that action at this time.
0 commit comments