|
|
@ -1,77 +1,75 @@ |
|
|
|
import React from "react"; |
|
|
|
import React from "react"; |
|
|
|
|
|
|
|
import Button from "../../Button"; |
|
|
|
import "./BlogDesign2.scss"; |
|
|
|
import CommentIcon from "../../MiniComponents/CommentIcon"; |
|
|
|
|
|
|
|
import NewTagDesign from "../../NewTagDesign"; |
|
|
|
import blogFeaturedImage2 from "../assets/blog-featured-image2.jpg"; |
|
|
|
|
|
|
|
import blogAuthorImg from "../assets/blog-author.png"; |
|
|
|
|
|
|
|
import whiteCommentIcon from "../assets/white-comment-icon.svg"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const BlogDesign2 = ({ |
|
|
|
const BlogDesign2 = ({ |
|
|
|
|
|
|
|
blogTitle, |
|
|
|
blogSubTitle, |
|
|
|
blogSubTitle, |
|
|
|
|
|
|
|
featuredImage, |
|
|
|
dateButton, |
|
|
|
dateButton, |
|
|
|
tagButton, |
|
|
|
tagButton, |
|
|
|
blogAuthor, |
|
|
|
blogAuthor, |
|
|
|
|
|
|
|
blogAuthorImg, |
|
|
|
blogComments, |
|
|
|
blogComments, |
|
|
|
commentNumBgColor, |
|
|
|
|
|
|
|
commentNumTextColor, |
|
|
|
|
|
|
|
commentNumTopPosition, |
|
|
|
|
|
|
|
commentNumRightPosition, |
|
|
|
|
|
|
|
}) => { |
|
|
|
}) => { |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<section className="w-4/12 mx-auto p-4 bg-white rounded-md shadow-md my-8"> |
|
|
|
|
|
|
|
<div |
|
|
|
<div |
|
|
|
className="parent relative flex flex-col justify-end p-3 cursor-pointer" |
|
|
|
className="group min-w-[550px] relative flex flex-col justify-end p-4 cursor-pointer" |
|
|
|
style={{ |
|
|
|
// style={{
|
|
|
|
backgroundImage: `url(${blogFeaturedImage2})`, |
|
|
|
// backgroundImage: `url(${featuredImage})`,
|
|
|
|
backgroundSize: "100% 100%", |
|
|
|
// backgroundSize: "100% 100%",
|
|
|
|
backgroundRepeat: "no-repeat", |
|
|
|
// backgroundRepeat: "no-repeat",
|
|
|
|
// minHeight: "300px",
|
|
|
|
// // minHeight: "300px",
|
|
|
|
height: "calc(100vh/3)", |
|
|
|
// height: "calc(100vh/3)",
|
|
|
|
maxHeight: "300px", |
|
|
|
// maxHeight: "300px",
|
|
|
|
}} |
|
|
|
// }}
|
|
|
|
> |
|
|
|
> |
|
|
|
{dateButton && ( |
|
|
|
{dateButton && ( |
|
|
|
<button className="bg-yellow-100 rounded p-1 text-sm absolute left-2 top-4"> |
|
|
|
<Button |
|
|
|
1400/09/19 |
|
|
|
text={"1400/09/19"} |
|
|
|
</button> |
|
|
|
className={ |
|
|
|
|
|
|
|
"w-fit bg-yellow-100 p-2 rounded text-xs font-sansbold absolute left-2 top-4" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/> |
|
|
|
)} |
|
|
|
)} |
|
|
|
{tagButton && ( |
|
|
|
{tagButton && ( |
|
|
|
<button className="bg-yellow-100 rounded p-1 text-sm absolute left-2 top-4"> |
|
|
|
<NewTagDesign |
|
|
|
تگ |
|
|
|
title={"تگ"} |
|
|
|
</button> |
|
|
|
icon={false} |
|
|
|
|
|
|
|
tagClassName={ |
|
|
|
|
|
|
|
"w-fit bg-yellow-100 p-2 rounded text-xs font-sansbold absolute left-2 top-4" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/> |
|
|
|
)} |
|
|
|
)} |
|
|
|
<div className="z-10 child-text"> |
|
|
|
<div className="z-10 transition-all duration-300 transfrom group-hover:-translate-y-1"> |
|
|
|
<h2 className="text-white text-base font-bold leading-6"> |
|
|
|
{blogTitle && ( |
|
|
|
آیا مواد غذایی پر فیبر مفید هستند؟ |
|
|
|
<h2 className="text-base text-justify text-white font-sansbold leading-6"> |
|
|
|
|
|
|
|
{blogTitle} |
|
|
|
</h2> |
|
|
|
</h2> |
|
|
|
|
|
|
|
)} |
|
|
|
{blogSubTitle && ( |
|
|
|
{blogSubTitle && ( |
|
|
|
<h2 className="text-white text-base mt-2 font-bold leading-6"> |
|
|
|
<h2 className="text-white text-base mt-2 font-sansbold leading-6"> |
|
|
|
شما چه فکری می کنید |
|
|
|
شما چه فکری می کنید |
|
|
|
</h2> |
|
|
|
</h2> |
|
|
|
)} |
|
|
|
)} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div className="z-10 flex item-center justify-between w-full mt-4"> |
|
|
|
<div className="w-full flex item-center justify-between mt-4 z-10"> |
|
|
|
{blogAuthor && ( |
|
|
|
{blogAuthor && ( |
|
|
|
<div className="flex items-center transition duration-200 transform hover:-translate-y-1"> |
|
|
|
<div className="flex items-center transition duration-200 transform hover:-translate-y-1"> |
|
|
|
<img src={blogAuthorImg} alt="" className="w-8 h-8" /> |
|
|
|
<img src={blogAuthorImg} alt="author" className="w-8" /> |
|
|
|
<p className="text-sm text-white font-light mr-2"> |
|
|
|
<p className="mr-2 text-sm text-white">{blogAuthor}</p> |
|
|
|
حامد دژبانی نسب |
|
|
|
|
|
|
|
</p> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
)} |
|
|
|
)} |
|
|
|
{blogComments && ( |
|
|
|
{blogComments && ( |
|
|
|
<div className="flex items-center"> |
|
|
|
<div className="flex items-center"> |
|
|
|
<p className="text-sm text-white font-light ml-2"> |
|
|
|
<p className="ml-2 text-sm text-white">{blogComments}</p> |
|
|
|
زمان مطالعه 30 دقیقه |
|
|
|
<CommentIcon |
|
|
|
</p> |
|
|
|
commentClassName="w-7" |
|
|
|
<div className="relative"> |
|
|
|
icon={"images/white-comment-icon.svg"} |
|
|
|
<img src={whiteCommentIcon} alt="" className="w-7 h-7" /> |
|
|
|
commentNum={"26"} |
|
|
|
<span |
|
|
|
className="w-5 h-5 bg-white text-[#818181] text-[10px] border-[#818181] font-sansbold absolute top-0 right-0 transform translate-x-1 -translate-y-2" |
|
|
|
className={`comment-num absolute ${commentNumBgColor} ${commentNumTextColor} ${commentNumTopPosition} ${commentNumRightPosition}`} |
|
|
|
/> |
|
|
|
> |
|
|
|
|
|
|
|
26 |
|
|
|
|
|
|
|
</span> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
)} |
|
|
|
)} |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -84,29 +82,22 @@ const BlogDesign2 = ({ |
|
|
|
className="absolute right-0 bottom-0 h-full w-full" |
|
|
|
className="absolute right-0 bottom-0 h-full w-full" |
|
|
|
></div> |
|
|
|
></div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</section> |
|
|
|
|
|
|
|
); |
|
|
|
); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
export default BlogDesign2; |
|
|
|
export default BlogDesign2; |
|
|
|
|
|
|
|
|
|
|
|
// background color i used in commnet number background color
|
|
|
|
BlogDesign2.defaultProps = { |
|
|
|
// bg-lightGrayBgColor
|
|
|
|
blogTitle: `آیا مواد غذای پر فیبر و مفید هستند؟`, |
|
|
|
// bg-white
|
|
|
|
blogSubTitle: `شما چه فکری می کنید`, |
|
|
|
|
|
|
|
|
|
|
|
// text color i used for comment number text color:
|
|
|
|
featuredImage: "images/blog-featured-image2.jpg", |
|
|
|
// text-grayTextColor
|
|
|
|
|
|
|
|
// text-white
|
|
|
|
blogAuthor: `حامد دژبانی نسب`, |
|
|
|
|
|
|
|
blogAuthorImg: "images/blog-author.png", |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
blogComments: `زمان مطالعه 30 دقیقه`, |
|
|
|
|
|
|
|
|
|
|
|
BlogDesign2.defaultProps = { |
|
|
|
|
|
|
|
blogSubTitle: true, |
|
|
|
|
|
|
|
dateButton: true, |
|
|
|
dateButton: true, |
|
|
|
tagButton: false, |
|
|
|
tagButton: false, |
|
|
|
blogAuthor: true, |
|
|
|
|
|
|
|
blogComments: true, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
commentNumBgColor: "bg-white", |
|
|
|
|
|
|
|
commentNumTextColor: "text-grayTextColor", |
|
|
|
|
|
|
|
commentNumTopPosition: "-top-2", |
|
|
|
|
|
|
|
commentNumRightPosition: "-right-2", |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|