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