@@ -5,48 +5,46 @@ export function ExampleTabs() {
55 const [ selectedIndex , setSelectedIndex ] = React . useState ( 0 ) ;
66
77 return (
8- < page style = { { backgroundColor : 'yellow' } } >
9- < tabs
10- selectedIndex = { selectedIndex }
11- onSelectedIndexChanged = { ( args ) => {
12- setSelectedIndex ( args . newIndex ) ;
13- } }
14- style = { { ...styles . fullSize , backgroundColor : 'orange' } }
15- >
16- { /* The bottomTab UI is created via tabStrip (the container) and tabStripItem (for each tab) */ }
17- < tabStrip nodeRole = "tabStrip" style = { { backgroundColor : 'red' } } >
18- < tabStripItem nodeRole = "items" >
19- < label nodeRole = "label" > Home</ label >
20- < image nodeRole = "image" src = "font://" className = "fas" />
21- </ tabStripItem >
22- < tabStripItem nodeRole = "items" className = "special" >
23- < label nodeRole = "label" > Account</ label >
24- < image nodeRole = "image" src = "font://" className = "fas" />
25- </ tabStripItem >
26- < tabStripItem nodeRole = "items" className = "special" >
27- < label nodeRole = "label" > Search</ label >
28- < image nodeRole = "image" src = "font://" className = "fas" />
29- </ tabStripItem >
30- </ tabStrip >
8+ < tabs
9+ selectedIndex = { selectedIndex }
10+ onSelectedIndexChanged = { ( args ) => {
11+ setSelectedIndex ( args . newIndex ) ;
12+ } }
13+ style = { { ...styles . fullSize , backgroundColor : 'orange' } }
14+ >
15+ { /* The bottomTab UI is created via tabStrip (the container) and tabStripItem (for each tab) */ }
16+ < tabStrip nodeRole = "tabStrip" style = { { backgroundColor : 'red' } } >
17+ < tabStripItem nodeRole = "items" >
18+ < label nodeRole = "label" > Home</ label >
19+ < image nodeRole = "image" src = "font://" className = "fas" />
20+ </ tabStripItem >
21+ < tabStripItem nodeRole = "items" className = "special" >
22+ < label nodeRole = "label" > Account</ label >
23+ < image nodeRole = "image" src = "font://" className = "fas" />
24+ </ tabStripItem >
25+ < tabStripItem nodeRole = "items" className = "special" >
26+ < label nodeRole = "label" > Search</ label >
27+ < image nodeRole = "image" src = "font://" className = "fas" />
28+ </ tabStripItem >
29+ </ tabStrip >
3130
32- { /* The number of tabContentItem components should corespond to the number of TabStripItem components */ }
33- < tabContentItem nodeRole = "items" >
34- < gridLayout style = { { ...styles . fullSize , backgroundColor : 'blue' } } >
35- < label style = { { color : 'white' } } > Home Page</ label >
36- </ gridLayout >
37- </ tabContentItem >
38- < tabContentItem nodeRole = "items" >
39- < gridLayout style = { { ...styles . fullSize , backgroundColor : 'cyan' } } >
40- < label style = { { color : 'black' } } > Account Page</ label >
41- </ gridLayout >
42- </ tabContentItem >
43- < tabContentItem nodeRole = "items" >
44- < gridLayout style = { { ...styles . fullSize , backgroundColor : 'magenta' } } >
45- < label style = { { color : 'black' } } > Search Page</ label >
46- </ gridLayout >
47- </ tabContentItem >
48- </ tabs >
49- </ page >
31+ { /* The number of tabContentItem components should corespond to the number of TabStripItem components */ }
32+ < tabContentItem nodeRole = "items" >
33+ < gridLayout style = { { ...styles . fullSize , backgroundColor : 'blue' } } >
34+ < label style = { { color : 'white' } } > Home Page</ label >
35+ </ gridLayout >
36+ </ tabContentItem >
37+ < tabContentItem nodeRole = "items" >
38+ < gridLayout style = { { ...styles . fullSize , backgroundColor : 'cyan' } } >
39+ < label style = { { color : 'black' } } > Account Page</ label >
40+ </ gridLayout >
41+ </ tabContentItem >
42+ < tabContentItem nodeRole = "items" >
43+ < gridLayout style = { { ...styles . fullSize , backgroundColor : 'magenta' } } >
44+ < label style = { { color : 'black' } } > Search Page</ label >
45+ </ gridLayout >
46+ </ tabContentItem >
47+ </ tabs >
5048 ) ;
5149}
5250
0 commit comments