reza fixed duration

master
Reza_ashrafi 3 years ago
parent 914bd79d94
commit 059e6e1dc9
  1. 8
      src/views/Course/Lesson/index.tsx
  2. 10
      src/views/VideoTube/LessonPlayList/index.tsx

@ -23,7 +23,13 @@ function Lesson({
const duration = (value: number) => {
const minute = value % 60;
const hour = Math.round(value / 60);
return (hour > 0 ? hour + " " + "ساعت" : "") + " " + minute + " " + "دقیقه";
return (
(hour > 0
? (hour.toString().length === 1 ? "0" + hour.toString() : hour) + ""
: "") +
":" +
(minute.toString().length === 1 ? "0" + minute.toString() : minute)
);
};
const setCategory = (catId: any, videoId: any) => {
localStorage.removeItem("bookId");

@ -13,6 +13,7 @@ function LessonPlayList({
realCategories,
vods,
theme,
userId
}: any) {
const bookId = localStorage.getItem("bookId");
const [open, setOpen] = useState(false);
@ -62,7 +63,7 @@ function LessonPlayList({
{bookId ? (
category.map((video: any, i: any) => (
<Link
to={video.isFreeVod ? "/video/" + video.id : "#"}
to={video.isFreeVod || +userId === 140 ? "/video/" + video.id : "#"}
className={
"lesson-playlist__item d-flex align-items-center" +
" " +
@ -72,7 +73,7 @@ function LessonPlayList({
key={i}
id={"listItem" + video.id}
onClick={() =>
video.isFreeVod ? setVideoActive(video) : setOpen(true)
video.isFreeVod || +userId === 140 ? setVideoActive(video) : setOpen(true)
}
>
<span className="lesson-playlist__item--count">
@ -98,7 +99,7 @@ function LessonPlayList({
))
) : (
<Link
to={category.isFreeVod ? "/video/" + category.id : "#"}
to={category.isFreeVod || +userId === 140 ? "/video/" + category.id : "#"}
className={
"lesson-playlist__item d-flex align-items-center" +
" " +
@ -106,7 +107,7 @@ function LessonPlayList({
"lesson-playlist__item--active")
}
onClick={() =>
category.isFreeVod ? setVideoActive(category) : setOpen(true)
category.isFreeVod || +userId === 140 ? setVideoActive(category) : setOpen(true)
}
id={"listItem" + category.id}
>
@ -143,6 +144,7 @@ export default connect(
selectedVideo: state.publicApi.selectedVideo,
realCategories: state.publicApi.bookInfo?.categories,
vods: state.publicApi.bookSection?.vods,
userId : state?.user?.status?.id
}),
{
setVideoActive: publicApi.setVideoActive,

Loading…
Cancel
Save