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