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