This repository was archived by the owner on Mar 30, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ import Overlay from '../views/overlay';
26
26
import CheckBox from '../views/checkbox' ;
27
27
import FAB from '../views/fab' ;
28
28
import Text from '../views/text' ;
29
+ import Tabs from '../views/tabs' ;
29
30
import Badge from '../views/badge' ;
30
31
import WhatsappClone from '../views/whatsappClone' ;
31
32
@@ -70,6 +71,7 @@ function RootNavigator() {
70
71
< Drawer . Screen name = "Buttons" component = { Buttons } />
71
72
< Drawer . Screen name = "Inputs" component = { Inputs } />
72
73
< Drawer . Screen name = "Text" component = { Text } />
74
+ < Drawer . Screen name = "Tabs" component = { Tabs } />
73
75
< Drawer . Screen name = "Lists" component = { Lists } />
74
76
< Drawer . Screen name = "Lists2" component = { Lists2 } />
75
77
< Drawer . Screen name = "LinearProgress" component = { LinearProgress } />
Original file line number Diff line number Diff line change
1
+ import React from 'react' ;
2
+ import { Text } from 'react-native' ;
3
+ import { Header } from './header' ;
4
+ import { Tab } from 'react-native-elements' ;
5
+
6
+ export default ( ) => {
7
+ const [ index , setIndex ] = React . useState ( 0 ) ;
8
+
9
+ return (
10
+ < >
11
+ < Header title = "Tab" />
12
+ < Tab
13
+ value = { index }
14
+ onChange = { ( e ) => setIndex ( e ) }
15
+ indicatorStyle = { {
16
+ backgroundColor : 'white' ,
17
+ height : 3 ,
18
+ } }
19
+ variant = "primary"
20
+ >
21
+ < Tab . Item
22
+ title = "Recent"
23
+ icon = { { name : 'timer' , type : 'ionicon' , color : 'white' } }
24
+ />
25
+ < Tab . Item
26
+ title = "favourite"
27
+ icon = { { name : 'heart' , type : 'ionicon' , color : 'white' } }
28
+ />
29
+ < Tab . Item
30
+ title = "cart"
31
+ icon = { { name : 'cart' , type : 'ionicon' , color : 'white' } }
32
+ />
33
+ </ Tab >
34
+ { ( ( ) => {
35
+ switch ( index ) {
36
+ case 0 :
37
+ return < Text > Recent</ Text > ;
38
+ case 1 :
39
+ return < Text > favourites</ Text > ;
40
+ case 2 :
41
+ return < Text > Your Cart</ Text > ;
42
+ default :
43
+ return null ;
44
+ }
45
+ } ) ( ) }
46
+ </ >
47
+ ) ;
48
+ } ;
You can’t perform that action at this time.
0 commit comments