7
7
Text ,
8
8
View ,
9
9
} from '@bluebase/components' ;
10
+
10
11
import React from 'react' ;
11
12
import storiesOf from '@bluebase/storybook-addon' ;
12
13
import { withInfo } from '@storybook/addon-info' ;
@@ -22,7 +23,7 @@ const DrawerContent = () => (
22
23
< Text style = { { margin : 10 , fontSize : 15 , textAlign : 'right' } } > Hello</ Text >
23
24
< Text style = { { margin : 10 , fontSize : 15 , textAlign : 'right' } } > World!</ Text >
24
25
< DrawerActions >
25
- { ( navigation ) => (
26
+ { navigation => (
26
27
< React . Fragment >
27
28
< Button title = "Open" onPress = { navigation . openDrawer } />
28
29
< Button title = "Close" onPress = { navigation . closeDrawer } />
@@ -44,76 +45,77 @@ const navigationView = () => (
44
45
) ;
45
46
stories
46
47
47
- . add ( 'Default props' , ( ) => (
48
- < DrawerLayout
49
- // open
50
- drawerWidth = { 200 }
51
- // drawerPosition="left"
52
- renderNavigationView = { navigationView }
53
- >
54
- < DrawerContent />
55
- </ DrawerLayout >
56
- ) )
48
+ . add ( 'Default props' , ( ) => (
49
+ < DrawerLayout
50
+ // open
51
+ drawerWidth = { 200 }
52
+ // drawerPosition="left"
53
+ renderNavigationView = { navigationView }
54
+ >
55
+ < DrawerContent />
56
+ </ DrawerLayout >
57
+ ) )
57
58
58
- . add ( 'Type: slide ' , ( ) => (
59
- < DrawerLayout
60
- renderNavigationView = { navigationView }
61
- drawerType = "slide"
62
- drawerWidth = { 200 }
63
- open
64
- >
65
- < DrawerContent />
66
- </ DrawerLayout >
67
- ) )
59
+ . add ( 'Right Positioned ' , ( ) => (
60
+ < DrawerLayout
61
+ // open
62
+ drawerWidth = { 200 }
63
+ drawerPosition = "right"
64
+ renderNavigationView = { navigationView }
65
+ >
66
+ < DrawerContent />
67
+ </ DrawerLayout >
68
+ ) )
68
69
69
- . add ( 'Type: slide, Nested' , ( ) => (
70
- < View style = { { flex : 1 } } >
71
- < View style = { { backgroundColor : 'red' , minHeight : 30 } } >
72
- < Text > Top</ Text >
73
- </ View >
74
- < View style = { { flex : 1 , flexDirection : 'row' , backgroundColor : 'red' } } >
75
- < View style = { { width : 150 , backgroundColor : 'yellow' } } >
76
- < Text > Left</ Text >
77
- </ View >
78
- < View style = { { flex : 1 , backgroundColor : 'green' } } >
79
- < DrawerLayout
80
- renderNavigationView = { navigationView }
81
- drawerType = "slide"
82
- drawerWidth = { 200 }
83
- open
84
- >
85
- < DrawerContent />
86
- </ DrawerLayout >
70
+ . add ( 'Type: slide' , ( ) => (
71
+ < DrawerLayout renderNavigationView = { navigationView } drawerType = "slide" drawerWidth = { 200 } open >
72
+ < DrawerContent />
73
+ </ DrawerLayout >
74
+ ) )
75
+
76
+ . add ( 'Type: slide, Nested' , ( ) => (
77
+ < View style = { { flex : 1 } } >
78
+ < View style = { { backgroundColor : 'red' , minHeight : 30 } } >
79
+ < Text > Top</ Text >
87
80
</ View >
88
- < View style = { { width : 150 , backgroundColor : 'blue' } } >
89
- < Text > Left</ Text >
81
+ < View style = { { flex : 1 , flexDirection : 'row' , backgroundColor : 'red' } } >
82
+ < View style = { { width : 150 , backgroundColor : 'yellow' } } >
83
+ < Text > Left</ Text >
84
+ </ View >
85
+ < View style = { { flex : 1 , backgroundColor : 'green' } } >
86
+ < DrawerLayout
87
+ renderNavigationView = { navigationView }
88
+ drawerType = "slide"
89
+ drawerWidth = { 200 }
90
+ open
91
+ >
92
+ < DrawerContent />
93
+ </ DrawerLayout >
94
+ </ View >
95
+ < View style = { { width : 150 , backgroundColor : 'blue' } } >
96
+ < Text > Left</ Text >
97
+ </ View >
90
98
</ View >
91
99
</ View >
92
- </ View >
93
- ) )
100
+ ) )
94
101
95
- . add ( 'Type: front, Nested' , ( ) => (
96
- < View style = { { flex : 1 } } >
97
- < View style = { { backgroundColor : 'red' , minHeight : 30 } } >
98
- < Text > Top</ Text >
99
- </ View >
100
- < View style = { { flex : 1 , flexDirection : 'row' , backgroundColor : 'red' } } >
101
- < View style = { { width : 150 , backgroundColor : 'yellow' } } >
102
- < Text > Left</ Text >
102
+ . add ( 'Type: front, Nested' , ( ) => (
103
+ < View style = { { flex : 1 } } >
104
+ < View style = { { backgroundColor : 'red' , minHeight : 30 } } >
105
+ < Text > Top</ Text >
103
106
</ View >
104
- < View style = { { flex : 1 , backgroundColor : 'green' } } >
105
- < DrawerLayout
106
- renderNavigationView = { navigationView }
107
- drawerType = "front"
108
- open
109
- >
110
- < DrawerContent />
111
- </ DrawerLayout >
112
- </ View >
113
- < View style = { { width : 150 , backgroundColor : 'blue' } } >
114
- < Text > Left</ Text >
107
+ < View style = { { flex : 1 , flexDirection : 'row' , backgroundColor : 'red' } } >
108
+ < View style = { { width : 150 , backgroundColor : 'yellow' } } >
109
+ < Text > Left</ Text >
110
+ </ View >
111
+ < View style = { { flex : 1 , backgroundColor : 'green' } } >
112
+ < DrawerLayout renderNavigationView = { navigationView } drawerType = "front" open >
113
+ < DrawerContent />
114
+ </ DrawerLayout >
115
+ </ View >
116
+ < View style = { { width : 150 , backgroundColor : 'blue' } } >
117
+ < Text > Left</ Text >
118
+ </ View >
115
119
</ View >
116
120
</ View >
117
- </ View >
118
- ) )
119
- ;
121
+ ) ) ;
0 commit comments