@@ -9,6 +9,7 @@ import BannerSection from '../components/common/banner';
9
9
import { Container , SubTitle , Button } from '../utils/base.styles' ;
10
10
import { baseEventsURL , futureEventsURL , pastEventsURL , imagePlaceholderURL } from '../utils/urls' ;
11
11
import EventCard from '../components/events/event-card' ;
12
+ import EventLoader from '../components/events/event-content-loader' ;
12
13
13
14
const EventsSection = styled . section `
14
15
${ space } ;
@@ -70,11 +71,9 @@ export default class Events extends React.Component {
70
71
71
72
renderEvents ( events , loadLimit ) {
72
73
if ( this . state . loading ) {
73
- return (
74
- < SubTitle inverted color = "#222" >
75
- Loading..
76
- </ SubTitle >
77
- ) ;
74
+ return [ 1 , 2 ] . map ( i => {
75
+ return < EventLoader key = { i } /> ;
76
+ } ) ;
78
77
} else if ( events . length === 0 ) {
79
78
return (
80
79
< SubTitle inverted color = "#222" >
@@ -132,6 +131,7 @@ export default class Events extends React.Component {
132
131
}
133
132
134
133
render ( ) {
134
+ const { loading } = this . state ;
135
135
return (
136
136
< Layout >
137
137
< BannerSection title = "Online & Offline Events" subTitle = "Because you cannot change the world alone" />
@@ -143,7 +143,8 @@ export default class Events extends React.Component {
143
143
Upcoming Events
144
144
</ h3 >
145
145
{ this . renderEvents ( this . state . futureEvents , this . state . futureEventsLoadLimit ) }
146
- { this . renderLoadMoreButton ( this . state . futureEvents . length , this . state . futureEventsLoadLimit , false ) }
146
+ { ! loading &&
147
+ this . renderLoadMoreButton ( this . state . futureEvents . length , this . state . futureEventsLoadLimit , false ) }
147
148
</ Box >
148
149
</ Flex >
149
150
< Flex direction = "column" align = "center" justify = "center" >
@@ -152,7 +153,8 @@ export default class Events extends React.Component {
152
153
Recent Events
153
154
</ h3 >
154
155
{ this . renderEvents ( this . state . pastEvents , this . state . pastEventsLoadLimit ) }
155
- { this . renderLoadMoreButton ( this . state . pastEvents . length , this . state . pastEventsLoadLimit , true ) }
156
+ { ! loading &&
157
+ this . renderLoadMoreButton ( this . state . pastEvents . length , this . state . pastEventsLoadLimit , true ) }
156
158
</ Box >
157
159
</ Flex >
158
160
</ Container >
0 commit comments