Commit 900b1fae by jaymehta

image

1 parent 00914e6b
import React, { useState } from "react";
import React, { useEffect, useState } from "react";
import ImageGallery from "react-image-gallery";
import Image from "next/image";
import { cleanImage } from "../../services/imageHandling";
const DetailGallery = ({ activityById }) => {
console.log("activityById here", activityById);
const images = [
{
original: "/images/product-gallery/01.png",
thumbnail: "/images/product-gallery/01.png"
},
{
original: "/images/product-gallery/01.png",
thumbnail: "/images/product-gallery/01.png"
},
{
original: "/images/product-gallery/01.png",
thumbnail: "/images/product-gallery/01.png"
},
{
original: "/images/product-gallery/01.png",
thumbnail: "/images/product-gallery/01.png"
},
{
original: "/images/product-gallery/01.png",
thumbnail: "/images/product-gallery/01.png"
},
{
original: "/images/product-gallery/01.png",
thumbnail: "/images/product-gallery/01.png"
}
];
// const images = [
// {
// original: "/images/product-gallery/01.png",
// thumbnail: "/images/product-gallery/01.png"
// },
// {
// original: "/images/product-gallery/01.png",
// thumbnail: "/images/product-gallery/01.png"
// },
// {
// original: "/images/product-gallery/01.png",
// thumbnail: "/images/product-gallery/01.png"
// },
// {
// original: "/images/product-gallery/01.png",
// thumbnail: "/images/product-gallery/01.png"
// },
// {
// original: "/images/product-gallery/01.png",
// thumbnail: "/images/product-gallery/01.png"
// },
// {
// original: "/images/product-gallery/01.png",
// thumbnail: "/images/product-gallery/01.png"
// }
// ];
// let images = [];
const [images, setimages] = useState([]);
useEffect(() => {
setimages(
activityById &&
activityById.data.attributes.imagesComponent.map(item => {
return {
original: cleanImage(item.image.data.attributes),
thumbnail: cleanImage(item.image.data.attributes)
};
})
);
}, [activityById]);
return (
<>
......@@ -56,6 +68,7 @@ const DetailGallery = ({ activityById }) => {
<div className="product-name">Edge City Climb</div>
</div>
</div>
{activityById && (
<div className="product-gallery">
<div className="row">
<div className="col-12">
......@@ -64,8 +77,8 @@ const DetailGallery = ({ activityById }) => {
</div>
</div>
</div>
</div>
)}
</>
);
};
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!