@@ -8,45 +8,45 @@ const cardImage = require('../../assets/images/card-example.jpg');
8
8
const chevronDown = require ( '../../assets/icons/chevronDown.png' ) ;
9
9
const chevronUp = require ( '../../assets/icons/chevronUp.png' ) ;
10
10
11
- const elements = [
12
- < Card style = { { marginBottom : 10 } } onPress = { ( ) => { } } >
13
- < Card . Section
14
- content = { [
15
- { text : 'Card #1' , text70 : true , grey10 : true } ,
16
- { text : 'card description' , text90 : true , grey50 : true }
17
- ] }
18
- style = { { padding : 20 } }
19
- />
20
- < Card . Section source = { cardImage2 } imageStyle = { { height : 120 } } />
21
- </ Card > ,
22
- < Card style = { { marginBottom : 10 } } onPress = { ( ) => { } } >
23
- < Card . Section
24
- content = { [
25
- { text : 'Card #2' , text70 : true , grey10 : true } ,
26
- { text : 'card description' , text90 : true , grey50 : true }
27
- ] }
28
- style = { { padding : 20 } }
29
- />
30
- < Card . Section source = { cardImage } imageStyle = { { height : 120 } } />
31
- </ Card > ,
32
- < Card style = { { marginBottom : 10 } } onPress = { ( ) => { } } >
33
- < Card . Section
34
- content = { [
35
- { text : 'Card #3' , text70 : true , grey10 : true } ,
36
- { text : 'card description' , text90 : true , grey50 : true }
37
- ] }
38
- style = { { padding : 20 } }
39
- />
40
- < Card . Section source = { cardImage2 } imageStyle = { { height : 120 } } />
41
- </ Card >
42
- ] ;
43
-
44
11
class ExpandableSectionScreen extends PureComponent {
45
12
state = {
46
13
expanded : false ,
47
14
top : false
48
15
} ;
49
16
17
+ elements = [
18
+ < Card key = { 0 } style = { { marginBottom : 10 } } onPress = { ( ) => this . onExpand ( ) } >
19
+ < Card . Section
20
+ content = { [
21
+ { text : 'Card #1' , text70 : true , grey10 : true } ,
22
+ { text : 'card description' , text90 : true , grey50 : true }
23
+ ] }
24
+ style = { { padding : 20 } }
25
+ />
26
+ < Card . Section imageSource = { cardImage2 } imageStyle = { { height : 120 } } />
27
+ </ Card > ,
28
+ < Card key = { 1 } style = { { marginBottom : 10 } } onPress = { ( ) => this . onExpand ( ) } >
29
+ < Card . Section
30
+ content = { [
31
+ { text : 'Card #2' , text70 : true , grey10 : true } ,
32
+ { text : 'card description' , text90 : true , grey50 : true }
33
+ ] }
34
+ style = { { padding : 20 } }
35
+ />
36
+ < Card . Section imageSource = { cardImage } imageStyle = { { height : 120 } } />
37
+ </ Card > ,
38
+ < Card key = { 2 } style = { { marginBottom : 10 } } onPress = { ( ) => this . onExpand ( ) } >
39
+ < Card . Section
40
+ content = { [
41
+ { text : 'Card #3' , text70 : true , grey10 : true } ,
42
+ { text : 'card description' , text90 : true , grey50 : true }
43
+ ] }
44
+ style = { { padding : 20 } }
45
+ />
46
+ < Card . Section imageSource = { cardImage2 } imageStyle = { { height : 120 } } />
47
+ </ Card >
48
+ ] ;
49
+
50
50
onExpand ( ) {
51
51
this . setState ( {
52
52
expanded : ! this . state . expanded
@@ -74,7 +74,7 @@ class ExpandableSectionScreen extends PureComponent {
74
74
getBodyElement ( ) {
75
75
return (
76
76
< Carousel pageWidth = { 350 } itemSpacings = { Spacings . s2 } >
77
- { _ . map ( elements , ( element , key ) => {
77
+ { _ . map ( this . elements , ( element , key ) => {
78
78
return (
79
79
< View key = { key } margin-12 >
80
80
{ element }
@@ -99,7 +99,7 @@ class ExpandableSectionScreen extends PureComponent {
99
99
onValueChange = { ( ) => {
100
100
this . setState ( { top : ! this . state . top } ) ;
101
101
} }
102
- > </ Switch >
102
+ / >
103
103
</ View >
104
104
< ExpandableSection
105
105
top = { top }
0 commit comments