|
|
|
@ -14,8 +14,9 @@ import { connect } from "react-redux"; |
|
|
|
|
import { publicApi } from "../../redux/actions"; |
|
|
|
|
import scroll from "../../util/scroll"; |
|
|
|
|
import Loader from "../../components/Loader"; |
|
|
|
|
import _ from "lodash"; |
|
|
|
|
|
|
|
|
|
function Course({ getInfo, info, categories, loading }: any) { |
|
|
|
|
function Course({ getInfo, info, categories, loading, theme }: any) { |
|
|
|
|
const [links, setLinks] = useState([ |
|
|
|
|
{ link: "/", name: "صفحه اصلی" }, |
|
|
|
|
{ link: "/courses", name: "دورهها" }, |
|
|
|
@ -25,7 +26,7 @@ function Course({ getInfo, info, categories, loading }: any) { |
|
|
|
|
useEffect(() => { |
|
|
|
|
scroll.goToTop(); |
|
|
|
|
getInfo({ |
|
|
|
|
bookId: location.getId() |
|
|
|
|
bookId: location.getId(), |
|
|
|
|
}); |
|
|
|
|
}, []); |
|
|
|
|
|
|
|
|
@ -36,9 +37,16 @@ function Course({ getInfo, info, categories, loading }: any) { |
|
|
|
|
localStorage.setItem("bookId", location.getId()); |
|
|
|
|
localStorage.removeItem("category"); |
|
|
|
|
}; |
|
|
|
|
const light = theme === "light"; |
|
|
|
|
return ( |
|
|
|
|
<div |
|
|
|
|
className="course main d-flex flex-column" |
|
|
|
|
className={_.join( |
|
|
|
|
[ |
|
|
|
|
"course main d-flex flex-column", |
|
|
|
|
light ? "course__light" : "course__dark", |
|
|
|
|
], |
|
|
|
|
" " |
|
|
|
|
)} |
|
|
|
|
style={{ filter: loading ? "blur(8px)" : "" }} |
|
|
|
|
> |
|
|
|
|
<Navbar /> |
|
|
|
@ -59,7 +67,10 @@ function Course({ getInfo, info, categories, loading }: any) { |
|
|
|
|
<i>{info?.vodTeacher}</i> |
|
|
|
|
</div> |
|
|
|
|
<div className="d-flex " style={{ minWidth: 150 }}> |
|
|
|
|
<div className="course-info-items d-flex align-items-center justify-content-around" style={{ minWidth: 150 }}> |
|
|
|
|
<div |
|
|
|
|
className="course-info-items d-flex align-items-center justify-content-around" |
|
|
|
|
style={{ minWidth: 150 }} |
|
|
|
|
> |
|
|
|
|
<img src={slide} alt="" /> |
|
|
|
|
<div className="d-flex flex-column" style={{ minWidth: 100 }}> |
|
|
|
|
<i>{info?.vodDuration} ساعت درس </i> |
|
|
|
@ -156,7 +167,7 @@ function Course({ getInfo, info, categories, loading }: any) { |
|
|
|
|
{/* <p>در این قسمت شاید یک متن جهت زیباسازی قرار بگیرد </p> */} |
|
|
|
|
</header> |
|
|
|
|
{categories?.map((lesson: any, i: any) => ( |
|
|
|
|
<Lesson key={i} lesson={lesson} /> |
|
|
|
|
<Lesson key={i} lesson={lesson} theme={theme} /> |
|
|
|
|
))} |
|
|
|
|
</section> |
|
|
|
|
</main> |
|
|
|
@ -175,6 +186,7 @@ export default connect( |
|
|
|
|
info: state.publicApi.bookInfo, |
|
|
|
|
categories: state.publicApi.categories, |
|
|
|
|
loading: state.publicApi.loading, |
|
|
|
|
theme: state.publicApi.theme, |
|
|
|
|
}), |
|
|
|
|
{ getInfo: publicApi.bookInfo } |
|
|
|
|
)(Course); |
|
|
|
|