parent
1b0086e570
commit
060a73b806
4 changed files with 215 additions and 15 deletions
@ -0,0 +1,66 @@ |
||||
import React from "react"; |
||||
|
||||
import "../../../../components/ProductImage/index.scss"; |
||||
|
||||
import productImg from "../../../../components/ProductImage/product-image.jpg"; |
||||
|
||||
const Videos = ({ videos }) => { |
||||
return ( |
||||
<div className="flex flex-row gap-5"> |
||||
<div |
||||
className="flex flex-col items-start justify-between" |
||||
// style={{ height: "calc(100vh / 2 * 9 / 16)" }}
|
||||
> |
||||
{videos.slice(0, 4).map((video, index) => ( |
||||
<div |
||||
className="relative rounded-md" |
||||
style={{ |
||||
width: "calc(100vh / 5.5 - 8px)", |
||||
height: "calc(100vh / 5.5 - 8px)", |
||||
}} |
||||
> |
||||
<img |
||||
key={index} |
||||
src={productImg} |
||||
alt="" |
||||
className={`rounded-sm w-full h-full`} |
||||
// style={{ height: "calc(100% - 8px)" }}
|
||||
// style={{ height: "calc(100% - 8px)" }}
|
||||
/> |
||||
{/* این خط پایین که نوشتم برای این است که ایندکس که جنسش استرینگ است رو به نامبر تبدیل کند */} |
||||
{Number(index) === 3 && ( |
||||
<div className="absolute w-full h-full bg-black bg-opacity-30 left-0 top-0 flex justify-center items-center text-white"> |
||||
<strong>+ {videos.length - 3}</strong> |
||||
</div> |
||||
)} |
||||
</div> |
||||
))} |
||||
</div> |
||||
<img |
||||
src={productImg} |
||||
alt="" |
||||
style={{ height: "calc(100vh * 9 / 16)", width: "calc(100vh)" }} |
||||
className="rounded-md" |
||||
/> |
||||
</div> |
||||
); |
||||
}; |
||||
// {[0, 1, 2, 3, 4].map((item, index) => (
|
||||
|
||||
// ))}
|
||||
|
||||
export default Videos; |
||||
|
||||
Videos.defaultProps = { |
||||
videos: [ |
||||
{ |
||||
image: productImg, |
||||
}, |
||||
{ |
||||
image: productImg, |
||||
}, |
||||
{ |
||||
image: productImg, |
||||
}, |
||||
], |
||||
}; |
Loading…
Reference in new issue