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 MatchesOverview from "../components/MatchesOverview" |
8
|
|
|
import MatchesSlider from "../components/MatchesSlider" |
9
|
|
|
import MatchesTabs from "../components/MatchesTabs" |
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 /> |
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 exclude={[`1`, `2`]} action="next" /> |
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
|
|
|
<MatchesTabs teamId="2" /> |
145
|
|
|
</Card> |
146
|
|
|
) |
147
|
|
|
renderATeamCalendarArticle = () => ( |
148
|
|
|
<Card |
149
|
|
|
className={`medium-6 large-12 cell`} |
150
|
|
|
title="The A-Team" |
151
|
|
|
hasTable={true} |
152
|
|
|
> |
153
|
|
|
<MatchesTabs teamId="1" /> |
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
|
|
|
{` `} |
175
|
|
|
<a href="tel:+32498735984">0498.73.59.84</a> |
176
|
|
|
</p> |
177
|
|
|
<p> |
178
|
|
|
Ter plaatse een tafel vragen kan, naargelang de beschikbaarheid op dat |
179
|
|
|
moment, maar hou er rekening mee dat we onze capaciteit hebben moeten |
180
|
|
|
verlagen om aan de regelgeving te kunnen voldoen. Wie zeker wil zijn |
181
|
|
|
van zijn plek kan beter reserveren. |
182
|
|
|
</p> |
183
|
|
|
</Card> |
184
|
|
|
<article className={`medium-6 large-12 cell tablebooker`}> |
185
|
|
|
<tbkr-bm-widget |
186
|
|
|
restaurant-id="34742560" |
187
|
|
|
source="website" |
188
|
|
|
use-modal="0" |
189
|
|
|
lang="nl" |
190
|
|
|
theme="light" |
191
|
|
|
></tbkr-bm-widget> |
192
|
|
|
<script src="https://reservations.tablebooker.com/tbkr-widget-import.min.js"></script> |
193
|
|
|
</article> |
194
|
|
|
</> |
195
|
|
|
) |
196
|
|
|
|
197
|
|
|
renderWebsiteFeedbackArticle = () => ( |
198
|
|
|
<Card |
199
|
|
|
className={`medium-6 large-12 cell card`} |
200
|
|
|
title="Website feedback" |
201
|
|
|
titleIcon="fa-commenting-o" |
202
|
|
|
> |
203
|
|
|
<p> |
204
|
|
|
Na lang zwoegen is onze nieuwe website eíndelijk online geraakt! We zijn |
205
|
|
|
heel benieuwd naar jullie mening of feedback. Als jullie vinden dat er |
206
|
|
|
iets ontbreekt, of als je bepaalde fouten tegenkomt, zouden we het ten |
207
|
|
|
zeerste appreciëren als je ons even iets laat weten op{` `} |
208
|
|
|
<a href="mailto:[email protected]" className={`rich-link`}> |
209
|
|
|
[email protected] |
210
|
|
|
</a> |
211
|
|
|
! |
212
|
|
|
</p> |
213
|
|
|
</Card> |
214
|
|
|
) |
215
|
|
|
renderExtraContentFooter = (preseason) => ( |
216
|
|
|
<section className="grid-container site-content"> |
217
|
|
|
<div className="grid-x grid-margin-x"> |
218
|
|
|
<section className={`cell large-12 featured-article`}> |
219
|
|
|
<CardImage |
220
|
|
|
title="Update voorbereiding 2020-2021" |
221
|
|
|
localFile={preseason} |
222
|
|
|
link="/games" |
223
|
|
|
metadata={false} |
224
|
|
|
/> |
225
|
|
|
</section> |
226
|
|
|
</div> |
227
|
|
|
</section> |
228
|
|
|
) |
229
|
|
|
|
230
|
|
|
// convertGraphqlToPlayerObject = (player) => { |
231
|
|
|
// return { |
232
|
|
|
// nameFirst: player.field_firstname, |
233
|
|
|
// nameLast: player.field_lastname, |
234
|
|
|
// shirtNr: player.field_shirtnumber, |
235
|
|
|
// position: player.field_position, |
236
|
|
|
// imageSrc: |
237
|
|
|
// player.relationships.field_image.localFile.childImageSharp.fixed.src, |
238
|
|
|
// link: player.path.alias, |
239
|
|
|
// } |
240
|
|
|
// } |
241
|
|
|
|
242
|
|
|
// renderPlayerOfTheWeek = (featuredPlayer) => |
243
|
|
|
// featuredPlayer.edges.map( |
244
|
|
|
// ({ node: potw }) => |
245
|
|
|
// potw.relationships.field_player && ( |
246
|
|
|
// <article |
247
|
|
|
// className={"medium-6 large-12 cell card"} |
248
|
|
|
// key={potw.relationships.field_player.field_firstname} |
249
|
|
|
// > |
250
|
|
|
// <header className={"card__header"}> |
251
|
|
|
// <h4>Speler van de week</h4> |
252
|
|
|
// </header> |
253
|
|
|
// <PlayerFeatured |
254
|
|
|
// player={this.convertGraphqlToPlayerObject( |
255
|
|
|
// potw.relationships.field_player |
256
|
|
|
// )} |
257
|
|
|
// /> |
258
|
|
|
// </article> |
259
|
|
|
// ) |
260
|
|
|
// ) |
261
|
|
|
|
262
|
|
|
renderPosts = (posts) => { |
263
|
|
|
let articleCount = 0 |
264
|
|
|
let kcvvTvCount = 0 |
265
|
|
|
|
266
|
|
|
return posts.map(({ node }, i) => { |
267
|
|
|
switch (node.internal.type) { |
268
|
|
|
case `node__article`: |
269
|
|
|
node.field_featured && (articleCount = articleCount + 2) |
270
|
|
|
!node.field_featured && articleCount++ |
271
|
|
|
return ( |
272
|
|
|
<Fragment key={i}> |
273
|
|
|
{node.field_featured && <NewsItemFeatured node={node} />} |
274
|
|
|
{!node.field_featured && ( |
275
|
|
|
<NewsItemCardRatio node={node} teaser={true} /> |
276
|
|
|
)} |
277
|
|
|
</Fragment> |
278
|
|
|
) |
279
|
|
|
case `node__kcvv_tv`: |
280
|
|
|
if (kcvvTvCount === 0) { |
281
|
|
|
articleCount = articleCount + 2 |
282
|
|
|
kcvvTvCount++ |
283
|
|
|
return ( |
284
|
|
|
<CardImage |
285
|
|
|
title={node.title} |
286
|
|
|
localFile={ |
287
|
|
|
node.relationships.field_media_article_image.relationships |
288
|
|
|
.field_media_image.localFile |
289
|
|
|
} |
290
|
|
|
link={node.field_website.uri} |
291
|
|
|
metadata={false} |
292
|
|
|
key={i} |
293
|
|
|
/> |
294
|
|
|
) |
295
|
|
|
} else { |
296
|
|
|
articleCount = articleCount + 2 |
297
|
|
|
kcvvTvCount++ |
298
|
|
|
return <KcvvTvCard node={node} teaser={true} key={i} /> |
299
|
|
|
} |
300
|
|
|
|
301
|
|
|
default: |
302
|
|
|
return `` |
303
|
|
|
} |
304
|
|
|
}) |
305
|
|
|
} |
306
|
|
|
|
307
|
|
|
combineAndSortPosts = (featuredPosts, kcvvTv) => { |
308
|
|
|
return [...featuredPosts.edges, ...kcvvTv.edges].sort((a, b) => |
309
|
|
|
a.node.timestamp < b.node.timestamp |
310
|
|
|
? 1 |
311
|
|
|
: b.node.timestamp < a.node.timestamp |
312
|
|
|
? -1 |
313
|
|
|
: 0 |
314
|
|
|
) |
315
|
|
|
} |
316
|
|
|
|
317
|
|
|
renderLayoutSidebar = () => { |
318
|
|
|
const { featuredPlayer } = this.props.data |
319
|
|
|
return ( |
320
|
|
|
<> |
321
|
|
|
{/* TABLEBOOKER WIDGET */} |
322
|
|
|
{/* { this.renderTablebooker() } */} |
323
|
|
|
|
324
|
|
|
{/* A TEAM OVERVIEW - SUMMARY OF MATCHES AND RANKING*/} |
325
|
|
|
{this.renderATeamCalendarArticle()} |
326
|
|
|
|
327
|
|
|
{/* B TEAM OVERVIEW - SUMMARY OF MATCHES AND RANKING */} |
328
|
|
|
{this.renderBTeamCalendarArticle()} |
329
|
|
|
|
330
|
|
|
{/* YOUTH TEAMS OVERVIEW - SUMMARY OF UPCOMING MATCHES */} |
331
|
|
|
{this.renderYouthCalendarArticle()} |
332
|
|
|
|
333
|
|
|
{/* PLAYER OF THE WEEK ARTICLE IF ANY */} |
334
|
|
|
{/* {featuredPlayer && this.renderPlayerOfTheWeek(featuredPlayer)} */} |
335
|
|
|
|
336
|
|
|
{/* INFO ARTICLE WITH SOCIAL MEDIA LINKS */} |
337
|
|
|
{this.renderSocialMediaArticle()} |
338
|
|
|
|
339
|
|
|
{/* INFO ARTICLE WITH REQUEST FOR WEBSITE FEEDBACK */} |
340
|
|
|
{this.renderWebsiteFeedbackArticle()} |
341
|
|
|
|
342
|
|
|
{/* INFO ARTICLE WITH "TROOPER" CONTENT */} |
343
|
|
|
{this.renderTrooperArticle()} |
344
|
|
|
|
345
|
|
|
{/* INFO ARTICLE WITH "MYMAKRO" CONTENT */} |
346
|
|
|
{this.renderMakroArticle()} |
347
|
|
|
</> |
348
|
|
|
) |
349
|
|
|
} |
350
|
|
|
|
351
|
|
|
renderLayoutMain = () => { |
352
|
|
|
const { featuredPosts, kcvvTv } = this.props.data |
353
|
|
|
const posts = this.combineAndSortPosts(featuredPosts, kcvvTv) |
354
|
|
|
|
355
|
|
|
return ( |
356
|
|
|
<> |
357
|
|
|
<UpcomingEvent /> |
358
|
|
|
|
359
|
|
|
{posts && this.renderPosts(posts)} |
360
|
|
|
</> |
361
|
|
|
) |
362
|
|
|
} |
363
|
|
|
|
364
|
|
|
render() { |
365
|
|
|
return ( |
366
|
|
|
<Layout> |
367
|
|
|
<SEO |
368
|
|
|
lang="nl-BE" |
369
|
|
|
title="Er is maar één plezante compagnie" |
370
|
|
|
description="Startpagina van stamnummer 00055: KCVV Elewijt." |
371
|
|
|
/> |
372
|
|
|
{/* {this.renderExtraContentFooter(this.props.data.preseason)} */} |
373
|
|
|
|
374
|
|
|
<section className="grid-container site-content"> |
375
|
|
|
{/* LIMITED-WIDTH CONTAINER WITH EXTRA (STICKY) CONTENT, IF ANY */} |
376
|
|
|
|
377
|
|
|
<div className="grid-x grid-margin-x"> |
378
|
|
|
<section className="cell large-8 news_overview__wrapper"> |
379
|
|
|
{/* MAIN CONTENT AREA */} |
380
|
|
|
{this.renderLayoutMain()} |
381
|
|
|
</section> |
382
|
|
|
<aside className="cell large-4"> |
383
|
|
|
<section className="grid-x featured__matches grid-margin-x"> |
384
|
|
|
{/* SIDEBAR CONTENT */} |
385
|
|
|
{this.renderLayoutSidebar()} |
386
|
|
|
</section> |
387
|
|
|
</aside> |
388
|
|
|
</div> |
389
|
|
|
</section> |
390
|
|
|
|
391
|
|
|
{/* FULL-WIDTH SLICK SLIDER WITH UPCOMING MATCHES */} |
392
|
|
|
{this.renderMatchSlider()} |
393
|
|
|
</Layout> |
394
|
|
|
) |
395
|
|
|
} |
396
|
|
|
} |
397
|
|
|
|
398
|
|
|
export const pageQuery = graphql` |
399
|
|
|
query { |
400
|
|
|
featuredPosts: allNodeArticle( |
401
|
|
|
filter: { status: { eq: true }, promote: { eq: true } } |
402
|
|
|
sort: { fields: created, order: DESC } |
403
|
|
|
limit: 10 |
404
|
|
|
) { |
405
|
|
|
edges { |
406
|
|
|
node { |
407
|
|
|
id |
408
|
|
|
path { |
409
|
|
|
alias |
410
|
|
|
} |
411
|
|
|
created(formatString: "D/M/YYYY") |
412
|
|
|
changed(formatString: "D/M/YYYY") |
413
|
|
|
timestamp: changed(formatString: "x") |
414
|
|
|
title |
415
|
|
|
promote |
416
|
|
|
status |
417
|
|
|
field_featured |
418
|
|
|
body { |
419
|
|
|
value |
420
|
|
|
format |
421
|
|
|
processed |
422
|
|
|
summary |
423
|
|
|
} |
424
|
|
|
relationships { |
425
|
|
|
field_media_article_image { |
426
|
|
|
...ArticleImage |
427
|
|
|
} |
428
|
|
|
field_tags { |
429
|
|
|
name |
430
|
|
|
path { |
431
|
|
|
alias |
432
|
|
|
} |
433
|
|
|
} |
434
|
|
|
} |
435
|
|
|
internal { |
436
|
|
|
type |
437
|
|
|
} |
438
|
|
|
} |
439
|
|
|
} |
440
|
|
|
} |
441
|
|
|
preseason: file(name: { eq: "preseason2020-2021" }) { |
442
|
|
|
...KCVVFluid960 |
443
|
|
|
} |
444
|
|
|
kcvvTv: allNodeKcvvTv( |
445
|
|
|
filter: { status: { eq: true }, promote: { eq: true } } |
446
|
|
|
sort: { fields: created, order: DESC } |
447
|
|
|
limit: 5 |
448
|
|
|
) { |
449
|
|
|
edges { |
450
|
|
|
node { |
451
|
|
|
id |
452
|
|
|
created(formatString: "D/M/YYYY") |
453
|
|
|
title |
454
|
|
|
timestamp: created(formatString: "x") |
455
|
|
|
relationships { |
456
|
|
|
field_media_article_image { |
457
|
|
|
...ArticleImage |
458
|
|
|
} |
459
|
|
|
} |
460
|
|
|
field_website { |
461
|
|
|
uri |
462
|
|
|
} |
463
|
|
|
internal { |
464
|
|
|
type |
465
|
|
|
} |
466
|
|
|
} |
467
|
|
|
} |
468
|
|
|
} |
469
|
|
|
featuredPlayer: allNodePotw( |
470
|
|
|
sort: { fields: created, order: DESC } |
471
|
|
|
filter: { status: { eq: true } } |
472
|
|
|
limit: 1 |
473
|
|
|
) { |
474
|
|
|
edges { |
475
|
|
|
node { |
476
|
|
|
relationships { |
477
|
|
|
field_player { |
478
|
|
|
field_firstname |
479
|
|
|
field_lastname |
480
|
|
|
field_shirtnumber |
481
|
|
|
field_position |
482
|
|
|
relationships { |
483
|
|
|
field_image { |
484
|
|
|
localFile { |
485
|
|
|
...KCVVFixedPlayerTeaser |
486
|
|
|
} |
487
|
|
|
} |
488
|
|
|
} |
489
|
|
|
path { |
490
|
|
|
alias |
491
|
|
|
} |
492
|
|
|
} |
493
|
|
|
} |
494
|
|
|
} |
495
|
|
|
} |
496
|
|
|
} |
497
|
|
|
} |
498
|
|
|
` |
499
|
|
|
|
500
|
|
|
export default IndexPage |
501
|
|
|
|