Gallery.js
1.65 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
import React, { useEffect } from "react";
import { Col, Container, Row } from "react-bootstrap";
import Heading from "@/components/Heading";
import Image from "next/image";
import { Fancybox } from "@fancyapps/ui";
import "@fancyapps/ui/dist/fancybox/fancybox.css";
const galleryData = [
{ id: 1, src: "/image/gallery/01.png", col: 6 },
{ id: 2, src: "/image/gallery/02.png", col: 6 },
{ id: 3, src: "/image/gallery/03.png", col: 12 },
{ id: 4, src: "/image/gallery/04.png", col: 6 },
{ id: 5, src: "/image/gallery/05.png", col: 6 },
];
const Gallery = () => {
useEffect(() => {
Fancybox.bind("[data-fancybox='gallery']", {
Hash: false,
Thumbs: false,
});
return () => {
Fancybox.destroy();
};
}, []);
return (
<section className="gallery-section sec_padd">
<Container className="custom_container">
<Row>
<Col className="d-flex justify-content-center">
<Heading el="h2" heading="Gallery" />
</Col>
</Row>
<Row className="gallery-items">
{galleryData.map((item) => (
<Col key={item.id} xs={item.col} className="mb-4">
<div className="gallery-image-wrapper">
<a
href={item.src}
data-fancybox="gallery"
>
<Image
src={item.src}
alt={`Gallery image ${item.id}`}
fill
className="gallery-image"
/>
</a>
</div>
</Col>
))}
</Row>
</Container>
</section>
);
};
export default Gallery;