|
|
|
@ -7,48 +7,54 @@ import "./index.scss"; |
|
|
|
|
|
|
|
|
|
export default function Courses(props: any) { |
|
|
|
|
const slideNumberHandler = () => { |
|
|
|
|
if(window.innerWidth >= 1440){ |
|
|
|
|
if (window.innerWidth >= 1440) { |
|
|
|
|
return 4; |
|
|
|
|
}else if(window.innerWidth >= 1008 && window.innerWidth < 1440){ |
|
|
|
|
} else if (window.innerWidth >= 1008 && window.innerWidth < 1440) { |
|
|
|
|
return 4; |
|
|
|
|
}else if(window.innerWidth > 640 && window.innerWidth < 1008 ){ |
|
|
|
|
} else if (window.innerWidth > 640 && window.innerWidth < 1008) { |
|
|
|
|
return 3; |
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
return 2; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
const { number, courses } = props; |
|
|
|
|
return ( |
|
|
|
|
<section className="home-courses d-flex flex-column"> |
|
|
|
|
<header className="d-flex flex-column"> |
|
|
|
|
<h1>جدیدترین دورهها</h1> |
|
|
|
|
<span>در این قسمت شاید یک متن جهت زیباسازی قرار بگیرد.</span> |
|
|
|
|
<header className="d-flex justify-content-between"> |
|
|
|
|
<div className="d-flex flex-column"> |
|
|
|
|
<h1>جدیدترین دورهها</h1> |
|
|
|
|
<span>در این قسمت شاید یک متن جهت زیباسازی قرار بگیرد.</span> |
|
|
|
|
</div> |
|
|
|
|
<Link to="/"> |
|
|
|
|
بیشتر |
|
|
|
|
</Link> |
|
|
|
|
</header> |
|
|
|
|
{ |
|
|
|
|
window.innerWidth > 1007 ? |
|
|
|
|
{window.innerWidth > 1007 ? ( |
|
|
|
|
<Carousel |
|
|
|
|
itemsToShow={slideNumberHandler()} |
|
|
|
|
isRTL={true} |
|
|
|
|
enableTilt={false} |
|
|
|
|
showArrows={true} |
|
|
|
|
pagination={false} |
|
|
|
|
> |
|
|
|
|
{courses.map((item : Object, i : Number) => ( |
|
|
|
|
<Course data={item} key={i} /> |
|
|
|
|
))} |
|
|
|
|
</Carousel> :
|
|
|
|
|
<div className="home-courses__list d-flex"> |
|
|
|
|
{courses.map((item : Object, i : Number) => ( |
|
|
|
|
<Course data={item} key={i} /> |
|
|
|
|
))} |
|
|
|
|
</div> |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
itemsToShow={slideNumberHandler()} |
|
|
|
|
isRTL={true} |
|
|
|
|
enableTilt={false} |
|
|
|
|
showArrows={true} |
|
|
|
|
pagination={false} |
|
|
|
|
> |
|
|
|
|
{courses.map((item: Object, i: Number) => ( |
|
|
|
|
<Course data={item} key={i} /> |
|
|
|
|
))} |
|
|
|
|
</Carousel> |
|
|
|
|
) : ( |
|
|
|
|
<div className="home-courses__list d-flex"> |
|
|
|
|
{courses.map((item: Object, i: Number) => ( |
|
|
|
|
<Course data={item} key={i} /> |
|
|
|
|
))} |
|
|
|
|
</div> |
|
|
|
|
)} |
|
|
|
|
|
|
|
|
|
<Link |
|
|
|
|
className="home-courses__more d-flex align-items-center" |
|
|
|
|
to="/courses" |
|
|
|
|
> |
|
|
|
|
مشاهده بیشتر <ExpandMoreRoundedIcon style={{ fontSize: 25, color : '#9CDF52' }} /> |
|
|
|
|
مشاهده بیشتر{" "} |
|
|
|
|
<ExpandMoreRoundedIcon style={{ fontSize: 25, color: "#9CDF52" }} /> |
|
|
|
|
</Link> |
|
|
|
|
</section> |
|
|
|
|
); |
|
|
|
|