-
setVideoActive(video)}
- >
-
{num}
-
-
-
22:05
+
+
+ {
+ realCategories.filter(
+ (item: any) => item.id === category[0].categoryId
+ )[0].name
+ }
+
+
+
+ {category.map((video: any, i: any) => (
+
setVideoActive(video)}
+ >
+
+ {Number(i) + 1}
+
+
+ {/*
*/}
+
+
22:05
+
+
+
{video.name}
+ {/*
{file.text}
*/}
+
-
-
{video.name}
- {/*
{file.text}
*/}
-
-
+ ))}
}
>
@@ -39,6 +65,7 @@ function LessonPlayList({ video, selectedVideo, setVideoActive, num }: any) {
export default connect(
(state: any) => ({
selectedVideo: state.publicApi.selectedVideo,
+ realCategories: state.publicApi.bookInfo?.categories,
}),
{
setVideoActive: publicApi.setVideoActive,
diff --git a/src/views/VideoTube/index.tsx b/src/views/VideoTube/index.tsx
index 1d3c349..0873b7a 100644
--- a/src/views/VideoTube/index.tsx
+++ b/src/views/VideoTube/index.tsx
@@ -15,9 +15,17 @@ import scroll from "../../util/scroll.js";
import { book, publicApi } from "../../redux/actions";
import Loader from "../../components/Loader";
-function VodTube({ selectedVideo, info, bookSection, loading }: any) {
+function VodTube({
+ selectedVideo,
+ info,
+ bookSection,
+ loading,
+ getInfo,
+ categories,
+ setVideoActive,
+}: any) {
useEffect(() => {
- const free: any = localStorage.getItem("free")?.split(",");
+ // const free: any = localStorage.getItem("free")?.split(",");
scroll.goToTop();
// getInfo({
// bookId: 1,
@@ -26,9 +34,12 @@ function VodTube({ selectedVideo, info, bookSection, loading }: any) {
// // window.location.pathname.length
// // ),
// });
- bookSection({ bookId: free[0], categoryId: free[1] });
+ getInfo({ bookId: localStorage.getItem("bookId") });
}, []);
+ useEffect(() => {
+ setVideoActive(categories[0][0]);
+ }, [info]);
return (
<>
*/}
-
+
درس دوم / بیست و یکم
{selectedVideo?.name}
{/*
{selectedVideo.text}
*/}
@@ -72,8 +83,8 @@ function VodTube({ selectedVideo, info, bookSection, loading }: any) {
- {info?.vods.map((video: any, i: any) => (
-
+ {categories?.map((video: any, i: any) => (
+
))}
@@ -135,10 +146,12 @@ export default connect(
selectedVideo: state.publicApi.selectedVideo,
info: state.publicApi.bookSection,
loading: state.publicApi.loading,
+ categories: state.publicApi.categories,
}),
{
getInfo: publicApi.bookInfo,
getBookList: book.list,
bookSection: publicApi.bookSection,
+ setVideoActive: publicApi.setVideoActive,
}
)(VodTube);