1
1
import * as React from 'react' ;
2
- import { StyleSheet } from 'react-nativescript' ;
3
2
4
3
export function ExampleTabs ( ) {
5
4
const [ selectedIndex , setSelectedIndex ] = React . useState ( 0 ) ;
@@ -10,61 +9,40 @@ export function ExampleTabs() {
10
9
onSelectedIndexChanged = { ( args ) => {
11
10
setSelectedIndex ( args . newIndex ) ;
12
11
} }
13
- style = { { ... styles . fullSize , backgroundColor : 'orange' } }
12
+ style = { { backgroundColor : 'orange' } }
14
13
>
15
14
{ /* The bottomTab UI is created via tabStrip (the container) and tabStripItem (for each tab) */ }
16
15
< tabStrip nodeRole = "tabStrip" style = { { backgroundColor : 'red' } } >
17
16
< tabStripItem nodeRole = "items" >
18
17
< label nodeRole = "label" > Home</ label >
19
18
< image nodeRole = "image" src = "font://" className = "fas" />
20
19
</ tabStripItem >
21
- < tabStripItem nodeRole = "items" className = "special" >
20
+ < tabStripItem nodeRole = "items" >
22
21
< label nodeRole = "label" > Account</ label >
23
22
< image nodeRole = "image" src = "font://" className = "fas" />
24
23
</ tabStripItem >
25
- < tabStripItem nodeRole = "items" className = "special" >
24
+ < tabStripItem nodeRole = "items" >
26
25
< label nodeRole = "label" > Search</ label >
27
26
< image nodeRole = "image" src = "font://" className = "fas" />
28
27
</ tabStripItem >
29
28
</ tabStrip >
30
29
31
30
{ /* The number of tabContentItem components should corespond to the number of TabStripItem components */ }
32
31
< tabContentItem nodeRole = "items" >
33
- < gridLayout style = { { ... styles . fullSize , backgroundColor : 'blue' } } >
32
+ < gridLayout style = { { backgroundColor : 'blue' } } >
34
33
< label style = { { color : 'white' } } > Home Page</ label >
35
34
</ gridLayout >
36
35
</ tabContentItem >
37
36
< tabContentItem nodeRole = "items" >
38
- < gridLayout style = { { ... styles . fullSize , backgroundColor : 'cyan' } } >
37
+ < gridLayout style = { { backgroundColor : 'cyan' } } >
39
38
< label style = { { color : 'black' } } > Account Page</ label >
40
39
</ gridLayout >
41
40
</ tabContentItem >
42
41
< tabContentItem nodeRole = "items" >
43
- < gridLayout style = { { ... styles . fullSize , backgroundColor : 'magenta' } } >
42
+ < gridLayout style = { { backgroundColor : 'magenta' } } >
44
43
< label style = { { color : 'black' } } > Search Page</ label >
45
44
</ gridLayout >
46
45
</ tabContentItem >
47
46
</ tabs >
48
47
) ;
49
48
}
50
-
51
- const styles = StyleSheet . create ( {
52
- fullSize : {
53
- height : '100%' ,
54
- width : '100%'
55
- } ,
56
- container : {
57
- height : '100%' ,
58
- flexDirection : 'column' ,
59
- justifyContent : 'center'
60
- } ,
61
- text : {
62
- textAlignment : 'center' ,
63
- fontSize : 24 ,
64
- color : 'black'
65
- } ,
66
- button : {
67
- fontSize : 24 ,
68
- color : '#2e6ddf'
69
- }
70
- } ) ;
0 commit comments