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