forked from layer5io/layer5
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
71 lines (69 loc) · 2.45 KB
/
index.js
File metadata and controls
71 lines (69 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import React from "react";
import Image from "../image";
import UpcomingEventsWrapper from "./EventCard.style";
import { Swiper, SwiperSlide } from "swiper/react";
import { Pagination, Mousewheel } from "swiper/modules";
import { Link } from "gatsby";
import "swiper/css/bundle";
import Button from "../../reusecore/Button";
import slugify from "../../utils/slugify";
const UpcomingEvents = ({ data }) => {
return (
<UpcomingEventsWrapper>
<div className="blog-slider swiper">
<div
style={{ display: "block" }}
className="blog-slider__wrp swiper-wrapper"
>
<Swiper
spaceBetween={50}
slidesPerView={1}
modules={[Mousewheel, Pagination]}
pagination={{ clickable: true }}
>
{data.nodes.map((item) => {
return (
<SwiperSlide key={item.id}>
<div className="blog-slider_item swiper-slide">
<div className="blog-slider_img">
<Link
to={`/community/events/${slugify(item.frontmatter.title)}`}
aria-label={`View event: ${item.frontmatter.title}`}
>
<Image
{...item.frontmatter.thumbnail}
alt={item.frontmatter.title}
width={480}
height={270}
/>
</Link>
</div>
<div className="blog-slider_content">
<h3 className="blog-slider_title">
{item.frontmatter.title}
</h3>
<p className="blog-slider_date">
{item.frontmatter.date}
</p>
<p className="blog-slider_description">
{item.frontmatter.abstract}
</p>
<Button
$secondary
className="blog-slider_button"
$url={item.frontmatter.eurl}
title="Join Now"
$external={true}
/>
</div>
</div>
</SwiperSlide>
);
})}
</Swiper>
</div>
</div>
</UpcomingEventsWrapper>
);
};
export default UpcomingEvents;