You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

103 lines
3.5 KiB

3 years ago
import React from "react";
import blogImage from "../../../assets/images/blog-featured-image.jpg";
import blogAuthorImg from "../../../assets/images/blog-author.png";
3 years ago
import commentIcon from "../../../assets/icons/light-gray-comment-icon.svg";
import whiteCommentIcon from "../../../assets/icons/white-comment-icon.svg";
3 years ago
3 years ago
const BlogDesign5 = ({
blogExcerpt,
blogAuthor,
blogComments,
commentNumBgColor,
commentNumTextColor,
commentNumTopPosition,
commentNumRightPosition,
}) => {
3 years ago
return (
3 years ago
<section className="w-5/12 mx-auto p-4 bg-gray-200 rounded-md shadow-md my-8">
3 years ago
{/* title holder */}
<div className="flex items-center justify-between mb-6">
<h2 className="text-productTitle bg-lime-200 p-2 rounded text-base">
طراحی بلاگ 5
</h2>
</div>
<div className="mb-6">
<p className="leading-10">
آدرس:
<span className="bg-blue-400 text-white rounded shadow-sm px-2 py-1 mx-2">
blogs/design5
</span>
</p>
</div>
{/* blog UI Design5 */}
3 years ago
<div className="flex items-strech justify-around p-4 rounded-md shadow-md bg-white">
<div className="w-2/5">
<img src={blogImage} alt="" className="w-full h-full" />
3 years ago
</div>
3 years ago
<div className="w-3/5 flex flex-col justify-between py-3 mr-4">
<div>
<h2 className="text-base text-justify text-grayTextColor">
آیا مواد غذای پر فیبر و مفید هستند؟
</h2>
{blogExcerpt && (
<p className="text-justify text-sm leading-6 text-grayTextColor mt-3 ">
در این قسمت یک توضیح بسیار کوتاه یا عادی در مورد ارور نوشته
خواهد شد. طراح سعی می کند تا این متن را بیشتر از خد انتظار بلند
کند تا دیگران متوجه شوند.
</p>
)}
</div>
3 years ago
<div className="flex item-center justify-between w-full">
3 years ago
{blogAuthor && (
3 years ago
<div className="flex items-center">
3 years ago
<img src={blogAuthorImg} alt="" className="w-8 h-8" />
<p className="text-sm text-lightGrayTextColor font-light mr-2">
3 years ago
حامد دژبانی نسب
</p>
</div>
)}
{blogComments && (
3 years ago
<div className="flex items-center">
3 years ago
<p className="text-sm text-lightGrayTextColor font-light ml-2">
3 years ago
زمان مطالعه 30 دقیقه
</p>
3 years ago
<div className="relative">
3 years ago
<img src={commentIcon} alt="" className="w-7 h-7" />
3 years ago
<span
className={`comment-num absolute ${commentNumBgColor} ${commentNumTextColor} ${commentNumTopPosition} ${commentNumRightPosition}`}
>
3 years ago
26
</span>
3 years ago
</div>
3 years ago
</div>
)}
</div>
</div>
</div>
</section>
);
};
export default BlogDesign5;
3 years ago
// background color i used in commnet number background color
// bg-lightGrayBgColor
// bg-white
// text color i used for comment number text color:
// text-grayTextColor
// text-white
3 years ago
BlogDesign5.defaultProps = {
blogExcerpt: true,
blogAuthor: true,
blogComments: true,
3 years ago
commentNumBgColor: "bg-lightGrayBgColor",
commentNumTextColor: "text-white",
commentNumTopPosition: "-top-2",
commentNumRightPosition: "-right-2",
3 years ago
};