File tree 1 file changed +4
-1
lines changed
YDS-Storybook/SwiftUI/Storybook/OptionView
1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,8 @@ struct OptionalStringOptionView: View {
27
27
@Binding private var text : String ?
28
28
29
29
private let description : String ?
30
-
30
+
31
+ @State private var isToggleOn = true
31
32
@State private var placeholder : String
32
33
33
34
init ( description: String ? , text: Binding < String ? > ) {
@@ -54,6 +55,7 @@ struct OptionalStringOptionView: View {
54
55
} ,
55
56
set: { isOn in
56
57
isOn ? ( text = placeholder) : ( text = nil )
58
+ self . isToggleOn = isOn
57
59
}
58
60
) )
59
61
. labelsHidden ( )
@@ -72,6 +74,7 @@ struct OptionalStringOptionView: View {
72
74
. font ( YDSFont . body1)
73
75
. tint ( YDSColor . textPointed)
74
76
. padding ( Dimension . Padding. button)
77
+ . foregroundColor ( isToggleOn ? YDSColor . bgNormalDark : YDSColor . bgDimDark)
75
78
. background (
76
79
RoundedRectangle ( cornerRadius: Dimension . Rectangle. cornerRadius)
77
80
. fill ( YDSColor . inputFieldElevated)
You can’t perform that action at this time.
0 commit comments