@@ -8,6 +8,7 @@ export const FullFormExample: FunctionComponent = () => {
88 < SwiftUI style = { { flex : 1 } } >
99 < SwiftUI . Text text = "FullFormExample" />
1010 < SwiftUI . Form >
11+ < RectangleSection />
1112 < TextFieldSection />
1213 < PickerSection />
1314 < DatePickerSection />
@@ -23,7 +24,7 @@ export const FullFormExample: FunctionComponent = () => {
2324const TextFieldSection : FunctionComponent = ( ) => {
2425 const [ firstName , setFirstName ] = useState ( 'John' ) ;
2526 return (
26- < SwiftUI . Section header = "TextField" >
27+ < SwiftUI . Section header = "TextField Example " >
2728 < SwiftUI . TextField
2829 label = "First name"
2930 placeholder = "John"
@@ -42,7 +43,7 @@ const PickerSection: FunctionComponent = () => {
4243 const [ options , setOptions ] = useState ( [ 'Option 1' , 'Option 2' , 'Option 3' ] ) ;
4344 const [ selectedOption , setSelectedOption ] = useState ( options [ 0 ] ) ;
4445 return (
45- < SwiftUI . Section header = "Picker" >
46+ < SwiftUI . Section header = "Picker Example " >
4647 < SwiftUI . Picker
4748 label = "Option"
4849 selection = { selectedOption }
@@ -62,7 +63,7 @@ const PickerSection: FunctionComponent = () => {
6263const DatePickerSection : FunctionComponent = ( ) => {
6364 const [ birthDate , setBirthDate ] = useState ( new Date ( '2019-06-03T00:00:00' ) ) ;
6465 return (
65- < SwiftUI . Section header = "DatePicker" >
66+ < SwiftUI . Section header = "DatePicker Example " >
6667 < SwiftUI . DatePicker
6768 label = "Birth date"
6869 selection = { birthDate }
@@ -86,7 +87,7 @@ const DatePickerSection: FunctionComponent = () => {
8687const ToggleSection : FunctionComponent = ( ) => {
8788 const [ isActive , setIsActive ] = useState ( false ) ;
8889 return (
89- < SwiftUI . Section header = "Toggle" >
90+ < SwiftUI . Section header = "Toggle Example " >
9091 < SwiftUI . Toggle
9192 label = "Enable Feature"
9293 isOn = { isActive }
@@ -103,7 +104,7 @@ const ToggleSection: FunctionComponent = () => {
103104const SliderSection : FunctionComponent = ( ) => {
104105 const [ volume , setVolume ] = useState ( 50 ) ;
105106 return (
106- < SwiftUI . Section header = "Slider" >
107+ < SwiftUI . Section header = "Slider Example " >
107108 < SwiftUI . Slider
108109 label = "Volume"
109110 value = { volume }
@@ -120,7 +121,7 @@ const SliderSection: FunctionComponent = () => {
120121const StepperSection : FunctionComponent = ( ) => {
121122 const [ value , setValue ] = useState ( 0 ) ;
122123 return (
123- < SwiftUI . Section header = "Stepper" >
124+ < SwiftUI . Section header = "Stepper Example " >
124125 < SwiftUI . Stepper
125126 label = "Value"
126127 value = { value }
@@ -134,3 +135,31 @@ const StepperSection: FunctionComponent = () => {
134135 </ SwiftUI . Section >
135136 ) ;
136137} ;
138+
139+ const RectangleSection : FunctionComponent = ( ) => {
140+ const [ color , setColor ] = useState ( 'blue' ) ;
141+
142+ return (
143+ < SwiftUI . Section header = "Rectangle Example" >
144+ < SwiftUI . HStack
145+ spacing = { 25 }
146+ style = { {
147+ backgroundColor : 'white' ,
148+ borderWidth : 1 ,
149+ borderColor : 'black' ,
150+ } } >
151+ < SwiftUI . Rectangle
152+ style = { { backgroundColor : color , width : 25 , height : 50 } }
153+ />
154+ < SwiftUI . Rectangle
155+ style = { { backgroundColor : 'red' , width : 25 , height : 50 } }
156+ />
157+ </ SwiftUI . HStack >
158+
159+ < SwiftUI . Button
160+ title = { `Change flag to ${ color === 'blue' ? 'Italy' : 'France' } ` }
161+ onPress = { ( ) => setColor ( color === 'blue' ? 'green' : 'blue' ) }
162+ />
163+ </ SwiftUI . Section >
164+ ) ;
165+ } ;
0 commit comments