diff --git a/src/components/JolPlayer/index.js b/src/components/JolPlayer/index.js index ced5873..afdcf9a 100644 --- a/src/components/JolPlayer/index.js +++ b/src/components/JolPlayer/index.js @@ -1,12 +1,12 @@ import JoLPlayer from "jol-player"; import file from "../../assets/videos/sea.mp4"; -const Video = () => { +const Video = ({fileIds}) => { return (
{ hideMouseTime : 10000, isShowPicture : true, isShowScreenshot : true, + isShowPauseButton : false, quality: [{ - name: "SD", url : `https://dnvn.ir/api/v1/file/0`, + name: "SD", url : `https://dnvn.ir/api/v1/file/${fileIds}`, }] }} /> diff --git a/src/components/Navbar/index.scss b/src/components/Navbar/index.scss index e2c9f4b..a2f0857 100644 --- a/src/components/Navbar/index.scss +++ b/src/components/Navbar/index.scss @@ -21,7 +21,8 @@ min-width : 130px; font-family: numeralLight; a{ - margin: 0px auto; + width : 100%; + height : 100%; } } } @@ -53,7 +54,10 @@ } &--buttons{ li{ - font-size: 18px; + a{ + font-size: 14px; + padding: 5px 0px; + } } } } @@ -62,6 +66,7 @@ } &___share{ margin-left: 20px; + font-size: 14px; } } @@ -74,7 +79,7 @@ &--links{ li{ padding: 0px 20px; - font-size: calc(100vw / 120); + font-size: calc(100vw / 115); span{ width: 2px; height: 15px; @@ -87,7 +92,8 @@ &--buttons{ li{ a{ - font-size: calc(100vw / 120); + font-size: calc(100vw / 115); + padding: 5px 0px; } min-width: 100px; } diff --git a/src/custom.scss b/src/custom.scss index b623071..92ede3b 100644 --- a/src/custom.scss +++ b/src/custom.scss @@ -217,6 +217,13 @@ display: none !important; } + +//JOL PLayer +.tooltip{ + opacity: 1 !important; + transform : translateY(-2px) !important; +} + @media screen and (min-width: 1441px) { .submit { font-size: 20px; diff --git a/src/redux/actions-type/book.tsx b/src/redux/actions-type/book.tsx index dcc328b..65002c2 100644 --- a/src/redux/actions-type/book.tsx +++ b/src/redux/actions-type/book.tsx @@ -4,7 +4,7 @@ interface list { } interface info { - type: "book/info"; + type: "public/bookVOD"; data: any; } diff --git a/src/redux/actions/book.tsx b/src/redux/actions/book.tsx index 73c9f3d..c78db45 100644 --- a/src/redux/actions/book.tsx +++ b/src/redux/actions/book.tsx @@ -8,7 +8,7 @@ const book = { info: (data = {}) => async (dispatch: Dispatch) => - await proxy.get("book/info", data, { dispatch }), + await proxy.get("public/bookVOD", data, { dispatch }), setLessonActive: (data: undefined) => async (dispatch: Dispatch) => await dispatch({ type: "book/lesson/active", data: data }), setVideoActive: (data: undefined) => async (dispatch: Dispatch) => diff --git a/src/redux/reducers/book.tsx b/src/redux/reducers/book.tsx index 73180be..4248b84 100644 --- a/src/redux/reducers/book.tsx +++ b/src/redux/reducers/book.tsx @@ -269,11 +269,7 @@ const initialState = { }, ], }, - selectedVideo: { - name: "ماهی های پرورشی و فواید آن ی", - src: sea, - text: "لورم اپیوسرم یک متن آزمایشی است که برای", - }, + selectedVideo: null, comments: [ { id: 0, @@ -295,7 +291,7 @@ const initialState = { gradeFilterBooks: null, sortFilterCourse: null, selectedGrade: null, - selectedSort: 'تمامی دوره‌ها', + selectedSort: "تمامی دوره‌ها", }; const grades = [ @@ -340,8 +336,14 @@ export default function book(state = initialState, action: BookAction) { filterResult: data, error: null, }; - case "book/info": - return { ...state, loading: false, info: data, error: null }; + case "public/bookVOD": + return { + ...state, + loading: false, + info: data, + selectedVideo: data.vods[0], + error: null, + }; case "book/lesson/active": return { ...state, @@ -378,11 +380,14 @@ export default function book(state = initialState, action: BookAction) { ); if (data.sort === "تمامی دوره‌ها") { return { ...state, sortFilterCourse: search, selectedSort: data.sort }; - } - else if(data.sort === 'جدیدترین‌ها'){ - return { ...state, sortFilterCourse: search.sort((item1 : any, item2 : any) => { - return item1.publishYear - item2.publishYear; - }), selectedSort: data.sort }; + } else if (data.sort === "جدیدترین‌ها") { + return { + ...state, + sortFilterCourse: search.sort((item1: any, item2: any) => { + return item1.publishYear - item2.publishYear; + }), + selectedSort: data.sort, + }; } return { ...state, sortFilterCourse: search, selectedSort: data.sort }; diff --git a/src/views/Course/Lesson/index.scss b/src/views/Course/Lesson/index.scss index 909e995..92f6759 100644 --- a/src/views/Course/Lesson/index.scss +++ b/src/views/Course/Lesson/index.scss @@ -50,6 +50,9 @@ @media screen and (min-width: 1441px) { .lesson { header { + img{ + margin-right: 5px; + } h4 { font-size: 21px; margin-right: 30px; @@ -79,6 +82,9 @@ @media screen and (min-width: 1008px) and (max-width: 1440px) { .lesson { header { + img{ + margin-right: 5px; + } h4 { font-size: calc(100vw / 75); margin-right: 30px; diff --git a/src/views/Course/index.scss b/src/views/Course/index.scss index af1f692..b524a31 100644 --- a/src/views/Course/index.scss +++ b/src/views/Course/index.scss @@ -1,7 +1,7 @@ .course{ main{ header{ - padding: 70px 0px 45px; + padding: 30px 0px 45px; border-bottom:2px solid #4a4a4a; } } @@ -88,7 +88,7 @@ flex: 4; &--image{ img{ - width: 320px; + // width: 320px; height: 420px; } } @@ -182,7 +182,7 @@ flex: 3; &--image{ img{ - width: 250px; + // width: 250px; height: 380px; } } @@ -224,6 +224,7 @@ height: 160px; margin-bottom: 30px; &__number{ + margin-bottom: 15px; i{ font-size: calc(100vw / 100); } @@ -246,7 +247,7 @@ width: 70%; height: 59px; padding: 0px 30px; - font-size: calc(100vw / 75); + font-size: calc(100vw / 100); border-radius: 40px; } } @@ -284,7 +285,7 @@ flex: 3; &--image{ img{ - width: 200px; + // width: 200px; height: 280px; } } diff --git a/src/views/Course/index.tsx b/src/views/Course/index.tsx index 126a928..15786eb 100644 --- a/src/views/Course/index.tsx +++ b/src/views/Course/index.tsx @@ -10,12 +10,13 @@ import slide from "../../assets/icons/slide.png"; import play from "../../assets/icons/play.png"; import bookmark from "../../assets/icons/bookmark.png"; import StyledRating from "../../components/StyledRating/index"; -import { connect, useSelector } from "react-redux"; -import scroll from '../../util/scroll'; +import { connect } from "react-redux"; +import { book } from "../../redux/actions"; +import scroll from "../../util/scroll"; import "./index.scss"; -function Course({ lessons }: any) { +function Course({ lessons, getInfo, info }: any) { const [links, setLinks] = useState([ { link: "/", name: "صفحه اصلی" }, { link: "/courses", name: "دوره‌ها" }, @@ -23,15 +24,14 @@ function Course({ lessons }: any) { ]); const [course, setCourse] = useState(undefined); useEffect(() => { - axios - .get("https://jsonplaceholder.typicode.com/photos/1") - .then((res: any) => { - setCourse(res.data); - }) - .catch((err) => { - console.log(err); - }); scroll.goToTop(); + getInfo({ + bookId: 18 + // window.location.pathname.slice( + // window.location.pathname.lastIndexOf("/") + 1, + // window.location.pathname.length + // ), + }); }, []); return ( @@ -41,12 +41,12 @@ function Course({ lessons }: any) {
- +
-

{course?.title?.slice(0, 25)}

+

{info?.name}

@@ -97,18 +97,18 @@ function Course({ lessons }: any) {
- -

{course?.title?.slice(0, 25)}

- 240 ساعت -
-
-

میانگین رای کاربران

-
- 10 - /2 -
+ +

{info?.name}

+ 240 ساعت +
+
+

میانگین رای کاربران

+
+ 10 + /2
- +
+
@@ -153,6 +153,7 @@ function Course({ lessons }: any) { export default connect( (state: any) => ({ lessons: state.book.mockLessons, + info : state.book.info, }), - {} + { getInfo: book.info } )(Course); diff --git a/src/views/VideoTube/Comment/index.scss b/src/views/VideoTube/Comment/index.scss index bb2704b..b65b832 100644 --- a/src/views/VideoTube/Comment/index.scss +++ b/src/views/VideoTube/Comment/index.scss @@ -9,6 +9,9 @@ border: none; margin-left: 20px; } + p{ + line-height: 1.5; + } } @media screen and (min-width: 1441px){ diff --git a/src/views/VideoTube/LessonPlayList/index.scss b/src/views/VideoTube/LessonPlayList/index.scss index 4477718..e87130a 100644 --- a/src/views/VideoTube/LessonPlayList/index.scss +++ b/src/views/VideoTube/LessonPlayList/index.scss @@ -1,7 +1,9 @@ .lesson-playlist{ width: 100%; + padding-bottom : 10px; header{ background-color: inherit !important; + margin-bottom: 5px; h3{ background-color : #707070; padding: 5px 10px; diff --git a/src/views/VideoTube/LessonPlayList/index.tsx b/src/views/VideoTube/LessonPlayList/index.tsx index 9a1f2d8..015f2f4 100644 --- a/src/views/VideoTube/LessonPlayList/index.tsx +++ b/src/views/VideoTube/LessonPlayList/index.tsx @@ -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 ( -
-
-

{lesson.name}

- -
- {lesson.files.map((file: any, i: any) => ( -
setVideoActive(file)} - > - {i + 1} -
- - 22:05 -
-
-

{file.name}

-

{file.text}

+ <> + {1 && ( +
+
+

{'بخش 1'}

+ +
+ {/* {lesson.files.map((file: any, i: any) => ( */} +
setVideoActive(video)} + > + {num} +
+ + 22:05 +
+
+

{video.name}

+ {/*

{file.text}

*/} +
+ {/* ))} */}
- ))} -
+ )} + ); } -export default connect((state: any) => ({ - selectedVideo: state.book.selectedVideo, -}), { - setVideoActive : book.setVideoActive, -})(LessonPlayList); +export default connect( + (state: any) => ({ + selectedVideo: state.book.selectedVideo, + }), + { + setVideoActive: book.setVideoActive, + } +)(LessonPlayList); diff --git a/src/views/VideoTube/index.scss b/src/views/VideoTube/index.scss index fadab3f..aec1337 100644 --- a/src/views/VideoTube/index.scss +++ b/src/views/VideoTube/index.scss @@ -159,7 +159,7 @@ .video-tube { main { max-width: 1350px; - margin-top: 30px; + margin-top: 10px; } &__content { flex: 8; @@ -253,7 +253,7 @@ .video-tube { main { max-width: 1250px; - margin-top: 30px; + margin-top: 10px; padding: 0px 10px; } &__content { diff --git a/src/views/VideoTube/index.tsx b/src/views/VideoTube/index.tsx index bfb1ac9..fbcd148 100644 --- a/src/views/VideoTube/index.tsx +++ b/src/views/VideoTube/index.tsx @@ -6,7 +6,7 @@ import Attachments from "./Attachments/index"; import Book from "./Book/index"; import Comment from "./Comment/index"; import AddComment from "./AddComment/index"; -import Video from '../../components/JolPlayer'; +import Video from "../../components/JolPlayer"; import "./index.scss"; import listIcon from "../../assets/icons/list.png"; @@ -14,9 +14,24 @@ import { connect } from "react-redux"; import scroll from "../../util/scroll.js"; import { book } from "../../redux/actions"; -function VodTube({ videoList, getList, list, selectedVideo, comments }: any) { +function VodTube({ + videoList, + getBookList, + list, + selectedVideo, + comments, + info, + getInfo, +}: any) { useEffect(() => { - getList(); + getBookList(); + getInfo({ + bookId: 18, + // window.location.pathname.slice( + // window.location.pathname.lastIndexOf("/") + 1, + // window.location.pathname.length + // ), + }); scroll.goToTop(); }, []); return ( @@ -28,10 +43,10 @@ function VodTube({ videoList, getList, list, selectedVideo, comments }: any) { {/* */} -