101 lines
3.5 KiB
101 lines
3.5 KiB
3 years ago
|
import React from "react";
|
||
|
|
||
|
import blogImage from "../assets/blog-featured-image.jpg";
|
||
|
import blogAuthorImg from "../assets/blog-author.png";
|
||
|
import commentIcon from "../assets/light-gray-comment-icon.svg";
|
||
|
|
||
|
const BlogDesign4 = ({
|
||
|
blogExcerpt,
|
||
|
blogAuthor,
|
||
|
blogComments,
|
||
|
commentNumBgColor,
|
||
|
commentNumTextColor,
|
||
|
commentNumTopPosition,
|
||
|
commentNumRightPosition,
|
||
|
}) => {
|
||
|
return (
|
||
|
<section className="w-4/12 mx-auto p-4 bg-white rounded-md shadow-md my-20 mb-8">
|
||
|
{/* title holder */}
|
||
|
<div className="flex items-center justify-between mb-6">
|
||
|
<h2 className="text-black bg-pink-200 p-2 rounded text-base">
|
||
|
طراحی بلاگ 4
|
||
|
</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/design4
|
||
|
</span>
|
||
|
</p>
|
||
|
</div>
|
||
|
{/* blog UI Design4 */}
|
||
|
<div className="flex items-strech justify-between relative p-2 rounded-xl border border-gray-300 ">
|
||
|
<div className="w-2/5 transform translate-x-1/3">
|
||
|
<img src={blogImage} alt="" className="w-full h-full " />
|
||
|
</div>
|
||
|
<div className="w-3/5 flex flex-col justify-between py-3 transform translate-x-10">
|
||
|
<div>
|
||
|
<h2 className="text-base text-grayTextColor font-bold leading-6">
|
||
|
آیا مواد غذای پر فیبر و مفید هستند؟
|
||
|
</h2>
|
||
|
{blogExcerpt && (
|
||
|
<p className="text-sm text-justify leading-6 text-grayTextColor mt-3">
|
||
|
در این قسمت یک توضیح بسیار کوتاه یا عادی در مورد ارور نوشته
|
||
|
خواهد شد. طراح سعی می کند تا این متن را بیشتر از خد انتظار بلند
|
||
|
کند تا دیگران متوجه شوند.
|
||
|
</p>
|
||
|
)}
|
||
|
</div>
|
||
|
<div className=" flex item-center justify-between">
|
||
|
{blogAuthor && (
|
||
|
<div className=" flex items-center">
|
||
|
<img src={blogAuthorImg} alt="" className="w-8 h-8" />
|
||
|
<p className="text-sm text-lightGrayTextColor font-light mr-2">
|
||
|
حامد دژبانی نسب
|
||
|
</p>
|
||
|
</div>
|
||
|
)}
|
||
|
{blogComments && (
|
||
|
<div className=" flex items-center">
|
||
|
<p className="text-sm text-lightGrayTextColor font-light ml-2">
|
||
|
زمان مطالعه 30 دقیقه
|
||
|
</p>
|
||
|
<div className="relative">
|
||
|
<img src={commentIcon} alt="" className="w-7 h-7" />
|
||
|
<span
|
||
|
className={`comment-num absolute ${commentNumBgColor} ${commentNumTextColor} ${commentNumTopPosition} ${commentNumRightPosition}`}
|
||
|
>
|
||
|
26
|
||
|
</span>
|
||
|
</div>
|
||
|
</div>
|
||
|
)}
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</section>
|
||
|
);
|
||
|
};
|
||
|
|
||
|
export default BlogDesign4;
|
||
|
|
||
|
// 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
|
||
|
|
||
|
BlogDesign4.defaultProps = {
|
||
|
blogExcerpt: true,
|
||
|
blogAuthor: true,
|
||
|
blogComments: true,
|
||
|
|
||
|
commentNumBgColor: "bg-lightGrayBgColor",
|
||
|
commentNumTextColor: "text-white",
|
||
|
commentNumTopPosition: "-top-2",
|
||
|
commentNumRightPosition: "-right-2",
|
||
|
};
|