update src/components/Blog/Design7/index.js, src/components/MiniComponents/OfferSection/index.js, data.js and tailwind.config.js
parent
364822f894
commit
691d2142c3
5 changed files with 118 additions and 16 deletions
@ -0,0 +1,47 @@ |
||||
import React from "react"; |
||||
import OfferSection from "../../MiniComponents/OfferSection"; |
||||
import Design7 from "../../Blog/Design7"; |
||||
|
||||
const BlogShowcase1 = ({ articles }) => { |
||||
return ( |
||||
<section className="w-full p-2"> |
||||
<OfferSection /> |
||||
<div className="mt-5 flex flex-wrap items-center justify-between gap-4"> |
||||
{articles.map((article) => ( |
||||
<Design7 |
||||
featuredImage={article.featuredImage} |
||||
title={article.title} |
||||
cardClass={"w-[265px]"} |
||||
playImage={article.playImage} |
||||
/> |
||||
))} |
||||
</div> |
||||
</section> |
||||
); |
||||
}; |
||||
|
||||
export default BlogShowcase1; |
||||
|
||||
BlogShowcase1.defaultProps = { |
||||
articles: [ |
||||
{ |
||||
title: "ایا یخ های قطبی در حال اب شدن هستند؟ زنگ خطر به صدا در امد", |
||||
featuredImage: `url("images/offersectionalexander-mils-nG4ZimMIO_k-unsplash.svg")`, |
||||
playImage: false, |
||||
}, |
||||
{ |
||||
title: "همایش های بی خود و بی جهت برای مدیریت", |
||||
featuredImage: `url("images/offersectionalexander-mils-nG4ZimMIO_k-unsplash.svg")`, |
||||
playImage: false, |
||||
}, |
||||
{ |
||||
title: "کافین با کارامل مسیله چیست؟", |
||||
featuredImage: `url("images/offersectionkobby-mendez-w0_w3N_hG00-unsplash.svg")`, |
||||
playImage: false, |
||||
}, |
||||
{ |
||||
title: "ایا یخ های قطبی در حال اب شدن هستند؟ زنگ خطر به صدا در امد", |
||||
featuredImage: `url("images/offersectionno-revisions-Fa8lOzYsTss-unsplash.svg")`, |
||||
}, |
||||
], |
||||
}; |
@ -0,0 +1,25 @@ |
||||
import React, { useState } from "react"; |
||||
|
||||
import BlogShowcase1 from "./BlogShowcase1"; |
||||
|
||||
function ShowCase() { |
||||
const list = { |
||||
1: <BlogShowcase1 />, |
||||
}; |
||||
const [type, setType] = useState(1); |
||||
return ( |
||||
<div className="w-full flex flex-col items-center"> |
||||
<select |
||||
className="mb-10 w-20 bg-gray-200" |
||||
onChange={(e) => setType(e.target.value)} |
||||
> |
||||
{Object.keys(list).map((option, index) => ( |
||||
<option key={index}>{option}</option> |
||||
))} |
||||
</select> |
||||
{list[type]} |
||||
</div> |
||||
); |
||||
} |
||||
|
||||
export default ShowCase; |
Loading…
Reference in new issue