1
|
|
|
import React, { Component, Fragment } from "react" |
2
|
|
|
import { graphql } from "gatsby" |
3
|
|
|
|
4
|
|
|
import Layout from "../layouts/index" |
5
|
|
|
|
6
|
|
|
import SEO from "../components/seo" |
7
|
|
|
import MetaMatches from "../components/meta-matches" |
8
|
|
|
import MatchesOverview from "../components/matches-overview" |
9
|
|
|
import MatchesSlider from "../components/matches-slider" |
10
|
|
|
import { |
11
|
|
|
NewsItemFeatured, |
12
|
|
|
NewsItemCardRatio, |
13
|
|
|
KcvvTvCard, |
14
|
|
|
} from "../components/news-item" |
15
|
|
|
import { CardImage } from "../components/cards" |
16
|
|
|
import UpcomingEvent from "../components/upcoming-event" |
17
|
|
|
import PlayerFeatured from "../components/player--featured" |
18
|
|
|
|
19
|
|
|
import MyMakro from "../images/mymakrokcvv.jpg" |
20
|
|
|
|
21
|
|
|
class IndexPage extends Component { |
22
|
|
|
renderMatchSlider = () => ( |
23
|
|
|
<section className={"grid-container full"}> |
24
|
|
|
<MatchesSlider season="1920" regnumber="00055" /> |
25
|
|
|
</section> |
26
|
|
|
) |
27
|
|
|
renderSocialMediaArticle = () => ( |
28
|
|
|
<article className={"medium-6 large-12 cell social"}> |
29
|
|
|
<div className={"social-sidebar__wrapper"}> |
30
|
|
|
<a |
31
|
|
|
href="https://facebook.com/KCVVElewijt" |
32
|
|
|
className="btn-social-counter btn-social-counter--fb" |
33
|
|
|
target="_blank" |
34
|
|
|
rel="noopener noreferrer" |
35
|
|
|
> |
36
|
|
|
<div className="btn-social-counter__icon"> |
37
|
|
|
<i className="fa fa-facebook"></i> |
38
|
|
|
</div> |
39
|
|
|
<h5 className="btn-social-counter__title"> |
40
|
|
|
Volg onze Facebook pagina |
41
|
|
|
</h5> |
42
|
|
|
</a> |
43
|
|
|
<a |
44
|
|
|
href="https://twitter.com/kcvve" |
45
|
|
|
className="btn-social-counter btn-social-counter--twitter" |
46
|
|
|
target="_blank" |
47
|
|
|
rel="noopener noreferrer" |
48
|
|
|
> |
49
|
|
|
<div className="btn-social-counter__icon"> |
50
|
|
|
<i className="fa fa-twitter"></i> |
51
|
|
|
</div> |
52
|
|
|
<h5 className="btn-social-counter__title">Volg ons op Twitter</h5> |
53
|
|
|
</a> |
54
|
|
|
<a |
55
|
|
|
href="http://www.instagram.com/kcvve" |
56
|
|
|
className="btn-social-counter btn-social-counter--instagram" |
57
|
|
|
target="_blank" |
58
|
|
|
rel="noopener noreferrer" |
59
|
|
|
> |
60
|
|
|
<div className="btn-social-counter__icon"> |
61
|
|
|
<i className="fa fa-instagram"></i> |
62
|
|
|
</div> |
63
|
|
|
<h5 className="btn-social-counter__title">Volg ons op Instagram</h5> |
64
|
|
|
</a> |
65
|
|
|
</div> |
66
|
|
|
</article> |
67
|
|
|
) |
68
|
|
|
renderMakroArticle = () => ( |
69
|
|
|
<article className={"medium-6 large-12 cell card"}> |
70
|
|
|
<header className={"card__header"}> |
71
|
|
|
<h4>MyMakro</h4> |
72
|
|
|
</header> |
73
|
|
|
<div className={"card__content"}> |
74
|
|
|
<p> |
75
|
|
|
Link nu jouw Makro voordeelkaart aan onze vereniging. Bij elke aankoop |
76
|
|
|
bij Makro en partners steun je KCVV Elewijt! |
77
|
|
|
</p> |
78
|
|
|
<p> |
79
|
|
|
<img src={MyMakro} alt="QR Code MyMakro" style={{ width: "100%" }} /> |
80
|
|
|
</p> |
81
|
|
|
<p> |
82
|
|
|
Scan bovenstaande QR-code met je camera op GSM, of surf naar{" "} |
83
|
|
|
<a |
84
|
|
|
href="https://my.makro.be/nl/link-vereniging/02277464" |
85
|
|
|
target="_blank" |
86
|
|
|
rel="noopener noreferrer" |
87
|
|
|
title="MyMakro link voor KCVV Elewijt" |
88
|
|
|
> |
89
|
|
|
https://my.makro.be/nl/link-vereniging/02277464 |
90
|
|
|
</a> |
91
|
|
|
. |
92
|
|
|
</p> |
93
|
|
|
<p>Onze vereniging dankt jullie van harte!</p> |
94
|
|
|
</div> |
95
|
|
|
</article> |
96
|
|
|
) |
97
|
|
|
renderYouthCalendarArticle = () => ( |
98
|
|
|
<article className={"medium-6 large-12 cell card"}> |
99
|
|
|
<header className="card__header"> |
100
|
|
|
<h4>Jeugdploegen</h4> |
101
|
|
|
</header> |
102
|
|
|
<MatchesOverview season="1920" regnumber="00055" exclude="['2A', '4D']" /> |
103
|
|
|
</article> |
104
|
|
|
) |
105
|
|
|
|
106
|
|
|
renderBTeamCalendarArticle = () => ( |
107
|
|
|
<article className={"medium-6 large-12 cell card"}> |
108
|
|
|
<header className={"card__header"}> |
109
|
|
|
<h4>The B-Team</h4> |
110
|
|
|
</header> |
111
|
|
|
<MetaMatches season="1920" region="bra" division="4D" regnumber="00055" /> |
112
|
|
|
</article> |
113
|
|
|
) |
114
|
|
|
renderATeamCalendarArticle = () => ( |
115
|
|
|
<article className={"medium-6 large-12 cell card"}> |
116
|
|
|
<header className={"card__header"}> |
117
|
|
|
<h4>The A-Team</h4> |
118
|
|
|
</header> |
119
|
|
|
<MetaMatches season="1920" region="bra" division="2A" regnumber="00055" /> |
120
|
|
|
</article> |
121
|
|
|
) |
122
|
|
|
|
123
|
|
|
renderWebsiteFeedbackArticle = () => ( |
124
|
|
|
<article className={"medium-6 large-12 cell card"}> |
125
|
|
|
<header className={"card__header"}> |
126
|
|
|
<h4> |
127
|
|
|
<i className={"fa fa-commenting-o"} aria-hidden="true"></i> Website |
128
|
|
|
feedback |
129
|
|
|
</h4> |
130
|
|
|
</header> |
131
|
|
|
<div className={"card__content"}> |
132
|
|
|
<p> |
133
|
|
|
Na lang zwoegen is onze nieuwe website eíndelijk online geraakt! We |
134
|
|
|
zijn heel benieuwd naar jullie mening of feedback. Als jullie vinden |
135
|
|
|
dat er iets ontbreekt, of als je bepaalde fouten tegenkomt, zouden we |
136
|
|
|
het ten zeerste appreciëren als je ons even iets laat weten op{" "} |
137
|
|
|
<a href="mailto:[email protected]" className={"rich-link"}> |
138
|
|
|
[email protected] |
139
|
|
|
</a> |
140
|
|
|
! |
141
|
|
|
</p> |
142
|
|
|
</div> |
143
|
|
|
</article> |
144
|
|
|
) |
145
|
|
|
renderExtraContentFooter = () => ( |
146
|
|
|
<> |
147
|
|
|
{/* <section className="grid-container site-content"> |
148
|
|
|
<div className="grid-x grid-margin-x"> |
149
|
|
|
<section className={'cell large-12 featured-article'}> |
150
|
|
|
<CardImage |
151
|
|
|
title="Voorbereidings- en bekerwedstrijden" |
152
|
|
|
localFile={data.preseason} |
153
|
|
|
link="/games" |
154
|
|
|
metadata={false} |
155
|
|
|
/> |
156
|
|
|
</section> |
157
|
|
|
</div> |
158
|
|
|
</section> */} |
159
|
|
|
</> |
160
|
|
|
) |
161
|
|
|
|
162
|
|
|
renderPlayerOfTheWeek = featuredPlayer => |
163
|
|
|
featuredPlayer.edges.map( |
164
|
|
|
({ node: potw }) => |
165
|
|
|
potw.relationships.field_player && ( |
166
|
|
|
<article |
167
|
|
|
className={"medium-6 large-12 cell card"} |
168
|
|
|
key={potw.relationships.field_player.field_firstname} |
169
|
|
|
> |
170
|
|
|
<header className={"card__header"}> |
171
|
|
|
<h4>Speler van de week</h4> |
172
|
|
|
</header> |
173
|
|
|
<PlayerFeatured player={potw.relationships.field_player} /> |
174
|
|
|
</article> |
175
|
|
|
) |
176
|
|
|
) |
177
|
|
|
|
178
|
|
|
renderPosts = posts => { |
179
|
|
|
let articleCount = 0 |
180
|
|
|
let kcvvTvCount = 0 |
181
|
|
|
|
182
|
|
|
return posts.map(({ node }, i) => { |
183
|
|
|
switch (node.internal.type) { |
184
|
|
|
case "node__article": |
185
|
|
|
node.field_featured && (articleCount = articleCount + 2) |
186
|
|
|
!node.field_featured && articleCount++ |
187
|
|
|
return ( |
188
|
|
|
<Fragment key={i}> |
189
|
|
|
{node.field_featured && <NewsItemFeatured node={node} />} |
190
|
|
|
{!node.field_featured && ( |
191
|
|
|
<NewsItemCardRatio node={node} teaser={true} /> |
192
|
|
|
)} |
193
|
|
|
</Fragment> |
194
|
|
|
) |
195
|
|
|
case "node__kcvv_tv": |
196
|
|
|
if (kcvvTvCount === 0) { |
197
|
|
|
articleCount = articleCount + 2 |
198
|
|
|
kcvvTvCount++ |
199
|
|
|
return ( |
200
|
|
|
<CardImage |
201
|
|
|
title={node.title} |
202
|
|
|
localFile={ |
203
|
|
|
node.relationships.field_media_article_image.relationships |
204
|
|
|
.field_media_image.localFile |
205
|
|
|
} |
206
|
|
|
link={node.field_website.uri} |
207
|
|
|
metadata={false} |
208
|
|
|
key={i} |
209
|
|
|
/> |
210
|
|
|
) |
211
|
|
|
} else { |
212
|
|
|
articleCount = articleCount + 2 |
213
|
|
|
kcvvTvCount++ |
214
|
|
|
return <KcvvTvCard node={node} teaser={true} key={i} /> |
215
|
|
|
} |
216
|
|
|
|
217
|
|
|
default: |
218
|
|
|
return "" |
219
|
|
|
} |
220
|
|
|
}) |
221
|
|
|
} |
222
|
|
|
|
223
|
|
|
render() { |
224
|
|
|
const { featuredPosts, kcvvTv, featuredPlayer = null } = this.props.data |
225
|
|
|
const posts = [...featuredPosts.edges, ...kcvvTv.edges].sort((a, b) => |
226
|
|
|
a.node.timestamp < b.node.timestamp |
227
|
|
|
? 1 |
228
|
|
|
: b.node.timestamp < a.node.timestamp |
229
|
|
|
? -1 |
230
|
|
|
: 0 |
231
|
|
|
) |
232
|
|
|
|
233
|
|
|
return ( |
234
|
|
|
<Layout> |
235
|
|
|
<SEO lang="nl-BE" title="Er is maar één plezante compagnie" /> |
236
|
|
|
|
237
|
|
|
<section className="grid-container site-content"> |
238
|
|
|
<div className="grid-x grid-margin-x"> |
239
|
|
|
<section className="cell large-8 news_overview__wrapper"> |
240
|
|
|
<UpcomingEvent /> |
241
|
|
|
|
242
|
|
|
{posts && this.renderPosts(posts)} |
243
|
|
|
</section> |
244
|
|
|
<aside className="cell large-4"> |
245
|
|
|
<section className="grid-x featured__matches grid-margin-x"> |
246
|
|
|
{/* A TEAM OVERVIEW - SUMMARY OF MATCHES AND RANKING*/} |
247
|
|
|
{this.renderATeamCalendarArticle()} |
248
|
|
|
|
249
|
|
|
{/* B TEAM OVERVIEW - SUMMARY OF MATCHES AND RANKING */} |
250
|
|
|
{this.renderBTeamCalendarArticle()} |
251
|
|
|
|
252
|
|
|
{/* YOUTH TEAMS OVERVIEW - SUMMARY OF UPCOMING MATCHES */} |
253
|
|
|
{this.renderYouthCalendarArticle()} |
254
|
|
|
|
255
|
|
|
{/* PLAYER OF THE WEEK ARTICLE IF ANY */} |
256
|
|
|
{featuredPlayer && this.renderPlayerOfTheWeek(featuredPlayer)} |
257
|
|
|
|
258
|
|
|
{/* INFO ARTICLE WITH SOCIAL MEDIA LINKS */} |
259
|
|
|
{this.renderSocialMediaArticle()} |
260
|
|
|
|
261
|
|
|
{/* INFO ARTICLE WITH REQUEST FOR WEBSITE FEEDBACK */} |
262
|
|
|
{this.renderWebsiteFeedbackArticle()} |
263
|
|
|
|
264
|
|
|
{/* INFO ARTICLE WITH "MYMAKRO" CONTENT */} |
265
|
|
|
{this.renderMakroArticle()} |
266
|
|
|
</section> |
267
|
|
|
</aside> |
268
|
|
|
</div> |
269
|
|
|
</section> |
270
|
|
|
|
271
|
|
|
{/* FULL-WIDTH SLICK SLIDER WITH UPCOMING MATCHES */} |
272
|
|
|
{this.renderMatchSlider()} |
273
|
|
|
|
274
|
|
|
{/* LIMITED-WIDTH CONTAINER WITH EXTRA (STICKY) CONTENT, IF ANY */} |
275
|
|
|
{this.renderExtraContentFooter()} |
276
|
|
|
</Layout> |
277
|
|
|
) |
278
|
|
|
} |
279
|
|
|
} |
280
|
|
|
|
281
|
|
|
export const pageQuery = graphql` |
282
|
|
|
query { |
283
|
|
|
featuredPosts: allNodeArticle( |
284
|
|
|
filter: { status: { eq: true }, promote: { eq: true } } |
285
|
|
|
sort: { fields: changed, order: DESC } |
286
|
|
|
limit: 10 |
287
|
|
|
) { |
288
|
|
|
edges { |
289
|
|
|
node { |
290
|
|
|
id |
291
|
|
|
path { |
292
|
|
|
alias |
293
|
|
|
} |
294
|
|
|
created(formatString: "D/M/YYYY") |
295
|
|
|
changed(formatString: "D/M/YYYY") |
296
|
|
|
timestamp: changed(formatString: "x") |
297
|
|
|
title |
298
|
|
|
promote |
299
|
|
|
status |
300
|
|
|
field_featured |
301
|
|
|
body { |
302
|
|
|
value |
303
|
|
|
format |
304
|
|
|
processed |
305
|
|
|
summary |
306
|
|
|
} |
307
|
|
|
relationships { |
308
|
|
|
field_media_article_image { |
309
|
|
|
...ArticleImage |
310
|
|
|
} |
311
|
|
|
field_tags { |
312
|
|
|
name |
313
|
|
|
path { |
314
|
|
|
alias |
315
|
|
|
} |
316
|
|
|
} |
317
|
|
|
} |
318
|
|
|
internal { |
319
|
|
|
type |
320
|
|
|
} |
321
|
|
|
} |
322
|
|
|
} |
323
|
|
|
} |
324
|
|
|
preseason: file(name: { eq: "preseason" }) { |
325
|
|
|
...KCVVFluid960 |
326
|
|
|
} |
327
|
|
|
kcvvTv: allNodeKcvvTv( |
328
|
|
|
filter: { status: { eq: true }, promote: { eq: true } } |
329
|
|
|
sort: { fields: created, order: DESC } |
330
|
|
|
limit: 5 |
331
|
|
|
) { |
332
|
|
|
edges { |
333
|
|
|
node { |
334
|
|
|
id |
335
|
|
|
created(formatString: "D/M/YYYY") |
336
|
|
|
title |
337
|
|
|
timestamp: created(formatString: "x") |
338
|
|
|
relationships { |
339
|
|
|
field_media_article_image { |
340
|
|
|
...ArticleImage |
341
|
|
|
} |
342
|
|
|
} |
343
|
|
|
field_website { |
344
|
|
|
uri |
345
|
|
|
} |
346
|
|
|
internal { |
347
|
|
|
type |
348
|
|
|
} |
349
|
|
|
} |
350
|
|
|
} |
351
|
|
|
} |
352
|
|
|
featuredPlayer: allNodePotw( |
353
|
|
|
sort: { fields: created, order: DESC } |
354
|
|
|
filter: { status: { eq: true } } |
355
|
|
|
limit: 1 |
356
|
|
|
) { |
357
|
|
|
edges { |
358
|
|
|
node { |
359
|
|
|
relationships { |
360
|
|
|
field_player { |
361
|
|
|
field_firstname |
362
|
|
|
field_lastname |
363
|
|
|
field_shirtnumber |
364
|
|
|
field_stats_games |
365
|
|
|
field_position |
366
|
|
|
field_stats_cleansheets |
367
|
|
|
field_stats_goals |
368
|
|
|
field_stats_cards_yellow |
369
|
|
|
field_stats_cards_red |
370
|
|
|
relationships { |
371
|
|
|
field_image { |
372
|
|
|
localFile { |
373
|
|
|
...KCVVFixedPlayerTeaser |
374
|
|
|
} |
375
|
|
|
} |
376
|
|
|
} |
377
|
|
|
path { |
378
|
|
|
alias |
379
|
|
|
} |
380
|
|
|
} |
381
|
|
|
} |
382
|
|
|
} |
383
|
|
|
} |
384
|
|
|
} |
385
|
|
|
} |
386
|
|
|
` |
387
|
|
|
|
388
|
|
|
export default IndexPage |
389
|
|
|
|