|
|
|
@ -6,6 +6,7 @@ import lock from "../../../assets/icons/lock.png"; |
|
|
|
|
import "./index.scss"; |
|
|
|
|
import { connect } from "react-redux"; |
|
|
|
|
import { book } from "../../../redux/actions"; |
|
|
|
|
import LessonPlayList from "../../VideoTube/LessonPlayList"; |
|
|
|
|
|
|
|
|
|
function Lesson(props: any) { |
|
|
|
|
const { lesson } = props; |
|
|
|
@ -24,7 +25,11 @@ function Lesson(props: any) { |
|
|
|
|
</div> |
|
|
|
|
</header> |
|
|
|
|
<header |
|
|
|
|
className="mobile justify-content-between align-items-center" |
|
|
|
|
className={ |
|
|
|
|
"mobile justify-content-between align-items-center" + |
|
|
|
|
" " + |
|
|
|
|
(!lesson.active && "lesson__active") |
|
|
|
|
} |
|
|
|
|
onClick={() => props.toggle(lesson.id)} |
|
|
|
|
> |
|
|
|
|
<div className="d-flex flex-column"> |
|
|
|
@ -35,24 +40,41 @@ function Lesson(props: any) { |
|
|
|
|
<img src={whiteDropdown} alt="" /> |
|
|
|
|
</div> |
|
|
|
|
</header> |
|
|
|
|
{lesson.active && ( |
|
|
|
|
<ul className="lesson__files d-flex flex-column"> |
|
|
|
|
{lesson.files.map((data: any, i: any) => ( |
|
|
|
|
<li className="lesson__files--sample d-flex justify-content-between align-items-center"> |
|
|
|
|
<div className="d-flex align-items-center"> |
|
|
|
|
{data.type === "video" && <img src={whitePlay} alt="" />} |
|
|
|
|
{data.type === "document" && <img src={document} alt="" />} |
|
|
|
|
<h5>{data.name}</h5> |
|
|
|
|
</div> |
|
|
|
|
<ul className="d-flex"> |
|
|
|
|
<li>{data.type !== "document" && data.duration}</li> |
|
|
|
|
<li>{data.view && "مشاهده"}</li> |
|
|
|
|
<li>{data.download ? "دانلود" : <img src={lock} alt="" />}</li> |
|
|
|
|
</ul> |
|
|
|
|
</li> |
|
|
|
|
))} |
|
|
|
|
</ul> |
|
|
|
|
)} |
|
|
|
|
<ul |
|
|
|
|
className={ |
|
|
|
|
"lesson__files d-flex flex-column" + |
|
|
|
|
" " + |
|
|
|
|
(lesson.active && "lesson__files--active") |
|
|
|
|
} |
|
|
|
|
style={{ |
|
|
|
|
height: lesson.active |
|
|
|
|
? lesson.files.length * |
|
|
|
|
(window.innerWidth > 1007 |
|
|
|
|
? window.innerWidth / 75 + 45 |
|
|
|
|
: window.innerWidth / 33 + 45) |
|
|
|
|
: "0px", |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
{lesson.files.map((data: any, i: any) => ( |
|
|
|
|
<li |
|
|
|
|
className="lesson__files--sample justify-content-between align-items-center" |
|
|
|
|
style={{ |
|
|
|
|
display: lesson.active ? "flex" : "none", |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
<div className="d-flex align-items-center"> |
|
|
|
|
{data.type === "video" && <img src={whitePlay} alt="" />} |
|
|
|
|
{data.type === "document" && <img src={document} alt="" />} |
|
|
|
|
<h5>{data.name}</h5> |
|
|
|
|
</div> |
|
|
|
|
<ul className="d-flex"> |
|
|
|
|
<li>{data.type !== "document" && data.duration}</li> |
|
|
|
|
<li>{data.view && "مشاهده"}</li> |
|
|
|
|
<li>{data.download ? "دانلود" : <img src={lock} alt="" />}</li> |
|
|
|
|
</ul> |
|
|
|
|
</li> |
|
|
|
|
))} |
|
|
|
|
</ul> |
|
|
|
|
</div> |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|