1+ import  React  from  'react' ; 
2+ import  {  storiesOf  }  from  '@storybook/react' ; 
3+ 
4+ import  {  Avatar  }  from  'react-native-elements' ; 
5+ 
6+ storiesOf ( 'Avatar|Icons' ,  module ) 
7+ 
8+  . add ( 'default size' ,  ( )  =>  ( 
9+  < Avatar 
10+  rounded 
11+  icon = { {  name : 'user' ,  type : 'font-awesome'  } } 
12+  onPress = { ( )  =>  console . log ( "Works!" ) } 
13+  activeOpacity = { 0.7 } 
14+  containerStyle = { {  flex : 2 ,  marginLeft : 20 ,  marginTop : 115  } } 
15+  /> 
16+  ) ) 
17+ 
18+  . add ( 'small size' ,  ( )  =>  ( 
19+  < Avatar 
20+  size = "small" 
21+  rounded 
22+  icon = { {  name : 'cake' ,  type : 'material'  } } 
23+  onPress = { ( )  =>  console . log ( "Works!" ) } 
24+  activeOpacity = { 0.7 } 
25+  containerStyle = { {  flex : 2 ,  marginLeft : 20 ,  marginTop : 115  } } 
26+  /> 
27+  ) ) 
28+ 
29+  . add ( 'medium size' ,  ( )  =>  ( 
30+  < Avatar 
31+  size = "medium" 
32+  overlayContainerStyle = { {  backgroundColor : 'blue'  } } 
33+  icon = { {  name : 'meetup' ,  color : 'red' ,  type : 'font-awesome'  } } 
34+  onPress = { ( )  =>  console . log ( "Works!" ) } 
35+  activeOpacity = { 0.7 } 
36+  containerStyle = { {  flex : 3 ,  marginTop : 100  } } 
37+  /> 
38+  ) ) 
39+ 
40+  . add ( 'large size' ,  ( )  =>  ( 
41+  < Avatar 
42+  size = "large" 
43+  icon = { {  name : 'rocket' ,  color : 'orange' ,  type : 'font-awesome'  } } 
44+  overlayContainerStyle = { {  backgroundColor : 'white'  } } 
45+  onPress = { ( )  =>  console . log ( "Works!" ) } 
46+  activeOpacity = { 0.7 } 
47+  containerStyle = { {  flex : 4 ,  marginTop : 75  } } 
48+  /> 
49+  ) ) 
50+ 
51+  . add ( 'xlarge size' ,  ( )  =>  ( 
52+  < Avatar 
53+  size = "xlarge" 
54+  rounded 
55+  icon = { {  name : 'home' ,  type : 'font-awesome'  } } 
56+  onPress = { ( )  =>  console . log ( "Works!" ) } 
57+  activeOpacity = { 0.7 } 
58+  containerStyle = { {  flex : 5 ,  marginRight : 60  } } 
59+  /> 
60+  ) ) 
61+ 
62+  . add ( 'with fixed size' ,  ( )  =>  ( 
63+  < Avatar 
64+  size = { 200 } 
65+  rounded 
66+  icon = { {  name : 'user' ,  type : 'font-awesome'  } } 
67+  onPress = { ( )  =>  console . log ( "Works!" ) } 
68+  activeOpacity = { 0.7 } 
69+  containerStyle = { {  flex : 2 ,  marginLeft : 20 ,  marginTop : 115  } } 
70+  /> 
71+  ) ) ; 
0 commit comments