|
|
@ -2,6 +2,7 @@ import React, { useEffect } from "react"; |
|
|
|
import "./index.scss"; |
|
|
|
import "./index.scss"; |
|
|
|
import { connect } from "react-redux"; |
|
|
|
import { connect } from "react-redux"; |
|
|
|
import { publicApi } from "../../../redux/actions"; |
|
|
|
import { publicApi } from "../../../redux/actions"; |
|
|
|
|
|
|
|
import { Link } from "react-router-dom"; |
|
|
|
|
|
|
|
|
|
|
|
function LessonPlayList({ |
|
|
|
function LessonPlayList({ |
|
|
|
category, |
|
|
|
category, |
|
|
@ -16,12 +17,12 @@ function LessonPlayList({ |
|
|
|
if (localStorage.getItem("scroll-list") && vods) { |
|
|
|
if (localStorage.getItem("scroll-list") && vods) { |
|
|
|
const list: HTMLElement = document.getElementById("list") as HTMLElement; |
|
|
|
const list: HTMLElement = document.getElementById("list") as HTMLElement; |
|
|
|
const listItem: HTMLElement = document.getElementById( |
|
|
|
const listItem: HTMLElement = document.getElementById( |
|
|
|
"listItem" + selectedVideo.id |
|
|
|
"listItem" + selectedVideo?.id |
|
|
|
) as HTMLElement; |
|
|
|
) as HTMLElement; |
|
|
|
const elementHeight: any = (listItem as any)?.offsetHeight; |
|
|
|
const elementHeight: any = (listItem as any)?.offsetHeight; |
|
|
|
const listHeight: any = (list as any).offsetHeight; |
|
|
|
const listHeight: any = (list as any).offsetHeight; |
|
|
|
const index = vods.findIndex(( |
|
|
|
const index = vods?.findIndex(( |
|
|
|
(item: any) => item.name === selectedVideo.name |
|
|
|
(item: any) => item?.name === selectedVideo?.name |
|
|
|
)); |
|
|
|
)); |
|
|
|
console.log(index); |
|
|
|
console.log(index); |
|
|
|
console.log(listHeight,elementHeight * (Number(index) + 1)); |
|
|
|
console.log(listHeight,elementHeight * (Number(index) + 1)); |
|
|
@ -52,7 +53,8 @@ function LessonPlayList({ |
|
|
|
|
|
|
|
|
|
|
|
{bookId ? ( |
|
|
|
{bookId ? ( |
|
|
|
category.map((video: any, i: any) => ( |
|
|
|
category.map((video: any, i: any) => ( |
|
|
|
<div |
|
|
|
<Link |
|
|
|
|
|
|
|
to={"/video/" + video.id} |
|
|
|
className={ |
|
|
|
className={ |
|
|
|
"lesson-playlist__item d-flex align-items-center" + |
|
|
|
"lesson-playlist__item d-flex align-items-center" + |
|
|
|
" " + |
|
|
|
" " + |
|
|
@ -82,10 +84,11 @@ function LessonPlayList({ |
|
|
|
<h4>{video.name}</h4> |
|
|
|
<h4>{video.name}</h4> |
|
|
|
{/* <p>{file.text}</p> */} |
|
|
|
{/* <p>{file.text}</p> */} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</Link> |
|
|
|
)) |
|
|
|
)) |
|
|
|
) : ( |
|
|
|
) : ( |
|
|
|
<div |
|
|
|
<Link |
|
|
|
|
|
|
|
to={"/video/" + category.id} |
|
|
|
className={ |
|
|
|
className={ |
|
|
|
"lesson-playlist__item d-flex align-items-center" + |
|
|
|
"lesson-playlist__item d-flex align-items-center" + |
|
|
|
" " + |
|
|
|
" " + |
|
|
@ -112,7 +115,7 @@ function LessonPlayList({ |
|
|
|
<h4>{category.name}</h4> |
|
|
|
<h4>{category.name}</h4> |
|
|
|
{/* <p>{file.text}</p> */} |
|
|
|
{/* <p>{file.text}</p> */} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</Link> |
|
|
|
)} |
|
|
|
)} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
} |
|
|
|
} |
|
|
|