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