parent
7d72b50b1d
commit
c0bb31ac48
14 changed files with 153 additions and 97 deletions
@ -1,44 +1,52 @@ |
||||
import React from "react"; |
||||
import "./index.scss"; |
||||
import { connect } from "react-redux"; |
||||
import {book} from '../../../redux/actions'; |
||||
import { book } from "../../../redux/actions"; |
||||
|
||||
function LessonPlayList({ lesson, selectedVideo,setVideoActive }: any) { |
||||
function LessonPlayList({ video, selectedVideo, setVideoActive, num }: any) { |
||||
return ( |
||||
<> |
||||
{1 && ( |
||||
<div className="lesson-playlist d-flex flex-column"> |
||||
<header className="d-flex align-items-center"> |
||||
<h3>{lesson.name}</h3> |
||||
<h3>{'بخش 1'}</h3> |
||||
<span></span> |
||||
</header> |
||||
{lesson.files.map((file: any, i: any) => ( |
||||
{/* {lesson.files.map((file: any, i: any) => ( */} |
||||
<div |
||||
className={ |
||||
"lesson-playlist__item d-flex align-items-center" + ' ' + |
||||
(file.name === selectedVideo.name && |
||||
"lesson-playlist__item d-flex align-items-center" + |
||||
" " + |
||||
(video.id === selectedVideo.id && |
||||
"lesson-playlist__item--active") |
||||
} |
||||
key={i} |
||||
onClick={() => setVideoActive(file)} |
||||
// key={i}
|
||||
onClick={() => setVideoActive(video)} |
||||
> |
||||
<span className="lesson-playlist__item--count">{i + 1}</span> |
||||
<span className="lesson-playlist__item--count">{num}</span> |
||||
<div className="lesson-playlist__item--video"> |
||||
<video> |
||||
<source src={file.src} /> |
||||
<source src={`https://dnvn.ir/api/v1/file/${video.fileIds}`} /> |
||||
</video> |
||||
<span>22:05</span> |
||||
</div> |
||||
<div className="lesson-playlist__item--text d-flex flex-column"> |
||||
<h4>{file.name}</h4> |
||||
<p>{file.text}</p> |
||||
<h4>{video.name}</h4> |
||||
{/* <p>{file.text}</p> */} |
||||
</div> |
||||
</div> |
||||
))} |
||||
{/* ))} */} |
||||
</div> |
||||
)} |
||||
</> |
||||
); |
||||
} |
||||
|
||||
export default connect((state: any) => ({ |
||||
export default connect( |
||||
(state: any) => ({ |
||||
selectedVideo: state.book.selectedVideo, |
||||
}), { |
||||
}), |
||||
{ |
||||
setVideoActive: book.setVideoActive, |
||||
})(LessonPlayList); |
||||
} |
||||
)(LessonPlayList); |
||||
|
Loading…
Reference in new issue