reza controlled vidoe selection

master
Reza_ashrafi 3 years ago
parent 8c8d936dc2
commit ad59726ceb
  1. 7
      src/views/Course/Lesson/index.tsx
  2. 4
      src/views/VideoTube/LessonPlayList/index.tsx

@ -5,6 +5,7 @@ import greenPlay from "../../../assets/icons/play-green.png";
import greenDocument from "../../../assets/icons/document-green.png"; import greenDocument from "../../../assets/icons/document-green.png";
import whitePlay from "../../../assets/icons/white-play.png"; import whitePlay from "../../../assets/icons/white-play.png";
import document from "../../../assets/icons/document.png"; import document from "../../../assets/icons/document.png";
import lock from "../../../assets/icons/lock.png";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { book, publicApi } from "../../../redux/actions"; import { book, publicApi } from "../../../redux/actions";
import location from "../../../util/location"; import location from "../../../util/location";
@ -123,7 +124,7 @@ function Lesson({
<img src={document} alt="" /> <img src={document} alt="" />
))} ))}
</Link> </Link>
<Link to={"/video/" + data.id} > <Link to={"/video/" + data.id}>
<img <img
className={ className={
selectedLesson === data.id selectedLesson === data.id
@ -142,9 +143,9 @@ function Lesson({
to={"/video/" + data.id} to={"/video/" + data.id}
onClick={() => setCategory(lesson[0].categoryId, data.name)} onClick={() => setCategory(lesson[0].categoryId, data.name)}
> >
<li>{"مشاهده"}</li> <li>مشاهده</li>
</Link> </Link>
{/* <li>{data.download ? "دانلود" : <img src={lock} alt="" />}</li> */} <li>{data.isFreeVOD ? "دانلود" : <img src={lock} alt="" />}</li>
</ul> </ul>
</li> </li>
{selectedLesson === data.id && ( {selectedLesson === data.id && (

@ -73,7 +73,7 @@ function LessonPlayList({
} }
key={i} key={i}
id={"listItem" + video.id} id={"listItem" + video.id}
onClick={() => setVideoActive(video)} onClick={() => video.isFreeVod ? setVideoActive(video) : {}}
> >
<span className="lesson-playlist__item--count"> <span className="lesson-playlist__item--count">
{Number(i) + 1} {Number(i) + 1}
@ -105,7 +105,7 @@ function LessonPlayList({
(category?.id === selectedVideo?.id && (category?.id === selectedVideo?.id &&
"lesson-playlist__item--active") "lesson-playlist__item--active")
} }
onClick={() => setVideoActive(category)} onClick={() => category.isFreeVod ? setVideoActive(category) : ''}
id={"listItem" + category.id} id={"listItem" + category.id}
> >
<span className="lesson-playlist__item--count"></span> <span className="lesson-playlist__item--count"></span>

Loading…
Cancel
Save