-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathindex.js
More file actions
54 lines (49 loc) · 1.97 KB
/
index.js
File metadata and controls
54 lines (49 loc) · 1.97 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
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)}`}>
<Image {...item.frontmatter.thumbnail} alt={item.frontmatter.title} />
</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 || `/community/events/${slugify(item.frontmatter.title)}`} title="Join Now" $external={!!item.frontmatter.eurl} />
</div>
</div>
</SwiperSlide>
);
})}
</Swiper>
</div>
</div>
</UpcomingEventsWrapper>
);
};
export default UpcomingEvents;