update src/components/Blogss/design4/index.js, src/components/Blogss/design5/index.js and src/components/Blogss/design6/index.js
parent
e7863fe944
commit
be6a3a8dc0
4 changed files with 145 additions and 187 deletions
After Width: | Height: | Size: 166 KiB |
@ -1,85 +1,68 @@ |
||||
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"; |
||||
import CommentIcon from "../../MiniComponents/CommentIcon"; |
||||
|
||||
const BlogDesign4 = ({ |
||||
blogTitle, |
||||
blogExcerpt, |
||||
featuredImage, |
||||
blogAuthor, |
||||
blogAuthorImg, |
||||
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"> |
||||
<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"> |
||||
آیا مواد غذای پر فیبر و مفید هستند؟ |
||||
<div className="flex items-strech justify-between p-4 bg-white rounded-xl border border-gray-300"> |
||||
<div className="transform translate-x-1/3"> |
||||
<img src={featuredImage} alt="" className="w-full h-full " /> |
||||
</div> |
||||
<div className="flex-1 flex flex-col justify-between py-3 transform translate-x-10"> |
||||
<div className="flex flex-col"> |
||||
{blogTitle && ( |
||||
<h2 className="text-base text-justify text-[#646464] font-sansbold leading-6"> |
||||
{blogTitle} |
||||
</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> |
||||
)} |
||||
{blogExcerpt && ( |
||||
<p className="mt-4 text-justify text-sm text-[#646464] leading-6"> |
||||
{blogExcerpt} |
||||
</p> |
||||
)} |
||||
</div> |
||||
<div className=" flex item-center justify-between"> |
||||
{blogAuthor && ( |
||||
<div className="flex items-center"> |
||||
<img src={blogAuthorImg} alt="author" className="w-8" /> |
||||
<p className="mr-2 text-sm text-[#818181]">{blogAuthor}</p> |
||||
</div> |
||||
)} |
||||
{blogComments && ( |
||||
<div className="flex items-center"> |
||||
<p className="ml-2 text-sm text-[#818181]">{blogComments}</p> |
||||
<CommentIcon |
||||
commentClassName="w-7" |
||||
commentNum={"26"} |
||||
className="w-5 h-5 bg-[#818181] text-white text-[10px] font-sansbold absolute top-0 right-0 transform translate-x-1 -translate-y-2" |
||||
/> |
||||
</div> |
||||
)} |
||||
</div> |
||||
</div> |
||||
</section> |
||||
</div> |
||||
); |
||||
}; |
||||
|
||||
export default BlogDesign4; |
||||
|
||||
// background color i used in commnet number background color
|
||||
// bg-lightGrayBgColor
|
||||
// bg-white
|
||||
BlogDesign4.defaultProps = { |
||||
blogTitle: `آیا مواد غذای پر فیبر و مفید هستند؟`, |
||||
blogExcerpt: `در این قسمت یک توضیح بسیار کوتاه یا عادی در مورد ارور نوشته خواهد
|
||||
شد. طراح سعی می کند تا این متن را بیشتر از خد انتظار بلند کند تا |
||||
دیگران متوجه شوند. |
||||
`,
|
||||
|
||||
// text color i used for comment number text color:
|
||||
// text-grayTextColor
|
||||
// text-white
|
||||
featuredImage: "images/blog-featured-image.jpg", |
||||
|
||||
BlogDesign4.defaultProps = { |
||||
blogExcerpt: true, |
||||
blogAuthor: true, |
||||
blogComments: true, |
||||
blogAuthor: `حامد دژبانی نسب`, |
||||
blogAuthorImg: "images/blog-author.png", |
||||
|
||||
commentNumBgColor: "bg-lightGrayBgColor", |
||||
commentNumTextColor: "text-white", |
||||
commentNumTopPosition: "-top-2", |
||||
commentNumRightPosition: "-right-2", |
||||
blogComments: `زمان مطالعه 30 دقیقه`, |
||||
}; |
||||
|
@ -1,81 +1,63 @@ |
||||
import React from "react"; |
||||
|
||||
import blogAuthorImg from "../assets/blog-author.png"; |
||||
import FeaturedImage from "../assets/article-featured-image.svg"; |
||||
import commentIcon from "../assets/light-gray-comment-icon.svg"; |
||||
import CommentIcon from "../../MiniComponents/CommentIcon"; |
||||
|
||||
const BlogDesign6 = ({ |
||||
blogTitle, |
||||
blogExcerpt, |
||||
featuredImage, |
||||
blogAuthor, |
||||
blogAuthorImg, |
||||
blogComments, |
||||
commentNumBgColor, |
||||
commentNumTextColor, |
||||
commentNumTopPosition, |
||||
commentNumRightPosition, |
||||
}) => { |
||||
return ( |
||||
<section className="w-5/12 mx-auto p-4 bg-white rounded-md shadow-md my-8"> |
||||
<div className=""> |
||||
<img src={FeaturedImage} alt="" className="w-full" /> |
||||
<div className="py-2"> |
||||
<h2 className="text-base text-justify text-grayTextColor mt-2 font-bold leading-6"> |
||||
آیا مواد غذای پر فیبر و مفید هستند؟ |
||||
<div className="flex flex-col p-4 bg-white rounded-md shadow-md"> |
||||
<img src={featuredImage} alt="" className="w-full" /> |
||||
<div className="p-4"> |
||||
{blogTitle && ( |
||||
<h2 className="text-base text-justify text-[#646464] font-sansbold leading-6"> |
||||
{blogTitle} |
||||
</h2> |
||||
{blogExcerpt && ( |
||||
<p className="text-justify text-sm leading-6 my-3 text-grayTextColor"> |
||||
در این قسمت یک توضیح بسیار کوتاه یا عادی در مورد ارور نوشته خواهد |
||||
شد. طراح سعی می کند تا این متن را بیشتر از خد انتظار بلند کند تا |
||||
دیگران متوجه شوند. |
||||
</p> |
||||
)} |
||||
{blogExcerpt && ( |
||||
<p className="mt-4 text-justify text-sm text-[#646464] leading-6"> |
||||
{blogExcerpt} |
||||
</p> |
||||
)} |
||||
<div className="w-full flex item-center justify-between mt-2"> |
||||
{blogAuthor && ( |
||||
<div className="flex items-center"> |
||||
<img src={blogAuthorImg} alt="author" className="w-8" /> |
||||
<p className="mr-2 text-sm text-[#818181]">{blogAuthor}</p> |
||||
</div> |
||||
)} |
||||
{blogComments && ( |
||||
<div className="flex items-center"> |
||||
<p className="ml-2 text-sm text-[#818181]">{blogComments}</p> |
||||
<CommentIcon |
||||
commentClassName="w-7" |
||||
commentNum={"26"} |
||||
className="w-5 h-5 bg-[#818181] text-white text-[10px] font-sansbold absolute top-0 right-0 transform translate-x-1 -translate-y-2" |
||||
/> |
||||
</div> |
||||
)} |
||||
<div className="flex item-center justify-between w-full mt-4"> |
||||
{blogAuthor && ( |
||||
<div className=" flex items-center"> |
||||
<img src={blogAuthorImg} alt="" className="w-8 h-8" /> |
||||
<p className="text-sm text-lightGrayTextColor mr-2"> |
||||
حامد دژبانی نسب |
||||
</p> |
||||
</div> |
||||
)} |
||||
{blogComments && ( |
||||
<div className=" flex items-center"> |
||||
<p className="text-sm text-lightGrayTextColor 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> |
||||
</div> |
||||
); |
||||
}; |
||||
|
||||
export default BlogDesign6; |
||||
|
||||
// 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
|
||||
|
||||
BlogDesign6.defaultProps = { |
||||
blogExcerpt: true, |
||||
blogAuthor: true, |
||||
blogComments: true, |
||||
blogTitle: `آیا مواد غذای پر فیبر و مفید هستند؟`, |
||||
blogExcerpt: `در این قسمت یک توضیح بسیار کوتاه یا عادی در مورد ارور نوشته خواهد
|
||||
شد. طراح سعی می کند تا این متن را بیشتر از خد انتظار بلند کند تا |
||||
دیگران متوجه شوند. |
||||
`,
|
||||
featuredImage: "images/article-featured-image.svg", |
||||
|
||||
blogAuthor: `حامد دژبانی نسب`, |
||||
blogAuthorImg: "images/blog-author.png", |
||||
|
||||
commentNumBgColor: "bg-lightGrayBgColor", |
||||
commentNumTextColor: "text-white", |
||||
commentNumTopPosition: "-top-2", |
||||
commentNumRightPosition: "-right-2", |
||||
blogComments: `زمان مطالعه 30 دقیقه`, |
||||
}; |
||||
|
Loading…
Reference in new issue