File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ export default class HomePage extends React.Component {
28
28
this . resizeTimeout = NaN ;
29
29
this . state = {
30
30
count : 0 ,
31
+ featuredProject : null ,
31
32
promotedProjects : [ ] ,
32
33
screenWidth : 0 ,
33
34
volunteerCount : 1500000
@@ -41,6 +42,7 @@ export default class HomePage extends React.Component {
41
42
addEventListener ( 'resize' , this . handleResize ) ;
42
43
this . handleResize ( ) ;
43
44
this . getClassificationCounts ( ) ;
45
+ this . getFeaturedProject ( ) ;
44
46
this . getVolunteerCount ( ) ;
45
47
this . getPromotedProjects ( ) ;
46
48
}
@@ -49,6 +51,14 @@ export default class HomePage extends React.Component {
49
51
removeEventListener ( 'resize' , this . handleResize ) ;
50
52
}
51
53
54
+ getFeaturedProject ( ) {
55
+ const query = { featured : true , launch_approved : true , cards : true } ;
56
+ return apiClient . type ( 'projects' ) . get ( query )
57
+ . then ( ( [ featuredProject ] ) => {
58
+ this . setState ( { featuredProject } ) ;
59
+ } ) ;
60
+ }
61
+
52
62
getVolunteerCount ( ) {
53
63
apiClient . type ( 'users' ) . get ( { page_size : 1 } )
54
64
. then ( ( [ user ] ) => {
@@ -128,7 +138,7 @@ export default class HomePage extends React.Component {
128
138
</ div >
129
139
130
140
< div className = "flex-container" >
131
- < FeaturedProject />
141
+ < FeaturedProject project = { this . state . featuredProject } />
132
142
</ div >
133
143
134
144
< div className = "flex-container" >
You can’t perform that action at this time.
0 commit comments