import React, { useState, useEffect, useRef } from "react"; import Navbar from "../../../components/Navbar"; import LessonPlayList from "./LessonPlayList"; import Attachments from "./Attachments"; import Book from "./Book"; import Comment from "./Comment"; import AddComment from "./AddComment"; import Video from "../../../components/JolPlayer"; import Test from "../Test"; import listIcon from "../../../assets/icons/list.png"; import { connect } from "react-redux"; import _ from "lodash"; import scroll from "../../../utils/scroll.js"; import location from "../../../utils/location.js"; import { book, publicApi } from "../../../redux/actions"; // import Loader from "../../components/Loader"; function VodTube({ autoPlay, page, selectedVideo, info, // bookSection, // loading, getInfo, // categories, // setVideoActive, // allBooks, theme, }) { const [top, setTop] = useState(window.innerHeight); const videoListTag = useRef(null); useEffect(() => { window.addEventListener("scroll", (e) => { setTop(scroll.homeScrollHandler(page)); }); // localStorage.setItem("scroll-list", "on"); getInfo({ bookId: 8, }); }, []); // useEffect(() => { // if (allBooks && localStorage.getItem("category")) { // const cat = localStorage.getItem("category")?.split(","); // bookSection({ bookId: cat[0], categoryId: cat[1] }); // } // }, [allBooks]); const light = theme === "light"; return (
e.stopPropagation()} className={_.join( [ "fixed flex flex-row rtl pt-20 lg:px-5 xl:px-10 w-full bg-white dark:bg-black bg-opacity-80 transition-opacity duration-500 min-h-screen backdrop-filter backdrop-blur-md", top > 0 ? "opacity-0 z-0" : "opacity-100 z-10", ], " " )} style={{ top: top }} > {/* */}
{/* درس دوم / بیست و یکم */}

{selectedVideo?.name}

{/*

{selectedVideo.text}

*/}

نظرات

{/*
{info?.comments?.map((comment, i) => ( ))}
*/}

{localStorage.getItem("category")?.split(",")[1] || "لیست فیلم‌ها"}

{/*

در این قسمت توضیحی کوتاه قرار می گیرد

*/}
{/* {localStorage.getItem("bookId") ? categories?.map((video, i) => ( )) : info?.vods.map((video, i) => ( ))} */} {/* {info?.vods.map((video, i) => ( */} {/* ))} */}
{1 > 0 && (

فایل پیوست تمارین این فصل

{/*

در این قسمت توضیحی کوتاه قرار می گیرد

*/}
{info?.attachments?.map((file, i) => ( ))}
)} {info?.related && (

پیشنهاد دانوین برای شما

تا 50% تخفیف
{info?.related.slice(0, 3).map((item, i) => ( ))}
)} {/*

نظرات

{info?.comments?.map((comment, i) => ( ))}
*/}
{/*
*/}
); } export default connect( (state) => ({ selectedVideo: state.publicApi.selectedVideo, info: state.publicApi?.bookInfo, loading: state.publicApi.loading, categories: state.publicApi.categories, allBooks: state.publicApi.bookInfo?.vods, theme: state.publicApi.theme, }), { getInfo: publicApi.bookInfo, getBookList: book.list, bookSection: publicApi.bookSection, setVideoActive: publicApi.setVideoActive, } )(VodTube);