reza added inital light mode

master
Reza 3 years ago
parent a3c35eb82d
commit 157d4e8f0c
  1. 3
      src/components/Navbar/index.scss
  2. 2
      src/views/About/index.tsx
  3. 27
      src/views/Auth/Login/index.scss
  4. 18
      src/views/Auth/Login/index.tsx
  5. 10
      src/views/Auth/SignUp/index.scss
  6. 34
      src/views/Auth/SignUp/index.tsx
  7. 14
      src/views/Auth/index.tsx
  8. 10
      src/views/Course/Lesson/index.scss
  9. 27
      src/views/Course/Lesson/index.tsx
  10. 18
      src/views/Course/index.scss
  11. 22
      src/views/Course/index.tsx
  12. 13
      src/views/Faq/index.scss
  13. 12
      src/views/Faq/index.tsx
  14. 13
      src/views/Home/AppDownload/index.scss
  15. 18
      src/views/Home/AppDownload/index.tsx
  16. 1
      src/views/Home/Footer/index.scss
  17. 7
      src/views/Home/Footer/index.tsx
  18. 4
      src/views/Home/index.tsx
  19. 16
      src/views/Subscription/SubscribeRadio/index.scss
  20. 25
      src/views/Subscription/SubscribeRadio/index.tsx
  21. 37
      src/views/Subscription/index.tsx
  22. 3
      src/views/VideoTube/AddComment/index.tsx
  23. 14
      src/views/VideoTube/LessonPlayList/index.scss
  24. 19
      src/views/VideoTube/LessonPlayList/index.tsx
  25. 36
      src/views/VideoTube/index.scss
  26. 18
      src/views/VideoTube/index.tsx

@ -12,6 +12,9 @@
background-color: $gray1 !important; background-color: $gray1 !important;
border: none !important; border: none !important;
} }
.MuiButton-root{
color: black !important;
}
} }
&__dark{ &__dark{
background-color: black; background-color: black;

@ -14,7 +14,7 @@ function About({ fury, advantages, keywords, keywords2, first, theme, setTheme }
<div <div
className={_.join([ className={_.join([
"about main d-flex flex-column", "about main d-flex flex-column",
theme === "dark" ? "main__light" : "main__dark", theme === "dark" ? "main__dark" : "main__light",
], " ")} ], " ")}
> >
<Navbar /> <Navbar />

@ -3,6 +3,30 @@
height: 100vh; height: 100vh;
position: relative; position: relative;
font-family: numeralLight; font-family: numeralLight;
&__light {
.MuiFormControl-root label{
background-color: white !important;
}
b{
color: black !important;
}
.login {
&__back {
a {
color: black !important;
}
}
&__options {
color: black;
a {
color: $green4;
}
}
}
}
&__dark {
background-color: black;
}
&__options { &__options {
color: #b5b5b5; color: #b5b5b5;
a { a {
@ -23,7 +47,6 @@
.MuiButtonBase-root { .MuiButtonBase-root {
padding: 0px !important; padding: 0px !important;
} }
background: black;
.footer { .footer {
position: fixed; position: fixed;
bottom: 0px; bottom: 0px;
@ -129,7 +152,6 @@
@media screen and (min-width: 641px) and (max-width: 1007px) { @media screen and (min-width: 641px) and (max-width: 1007px) {
.login { .login {
background: black;
.footer { .footer {
display: none !important; display: none !important;
} }
@ -190,7 +212,6 @@
@media screen and (max-width: 640px) { @media screen and (max-width: 640px) {
.login { .login {
background: black;
section { section {
// background-color: red; // background-color: red;
width: 90%; width: 90%;

@ -12,14 +12,14 @@ import arrow from "../../../assets/icons/dropdown.png";
import onInput from "../../../util/onInput"; import onInput from "../../../util/onInput";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { user } from "../../../redux/actions"; import { user } from "../../../redux/actions";
import _ from "lodash";
interface LoginFields { interface LoginFields {
username?: string; username?: string;
password?: string; password?: string;
} }
function Login({login, ...props}: any) { function Login({ login, theme, ...props }: any) {
const [loginFields, setSignUpFiels] = useState<LoginFields | undefined>( const [loginFields, setSignUpFiels] = useState<LoginFields | undefined>(
undefined undefined
); );
@ -29,11 +29,17 @@ function Login({login, ...props}: any) {
// const usernameInput = useRef<any>(); // const usernameInput = useRef<any>();
// const passwordInput = useRef<any>(); // const passwordInput = useRef<any>();
useEffect(() => { useEffect(() => {}, []);
}, []);
return ( return (
<div className="login d-flex flex-column align-items-center justify-content-center"> <div
className={_.join(
[
"login d-flex flex-column align-items-center justify-content-center",
theme === "light" ? "login__light" : "login__dark",
],
" "
)}
>
<Navbar /> <Navbar />
<section className="d-flex flex-column"> <section className="d-flex flex-column">
<div className="login__back d-flex justify-content-end"> <div className="login__back d-flex justify-content-end">

@ -3,10 +3,18 @@
height: 100vh; height: 100vh;
position: relative; position: relative;
font-family: numeralLight; font-family: numeralLight;
&__light{
background-color: white;
b{
color: black !important;
}
input{
background-color: white !important;
}
}
img { img {
// transform: rotate(-90deg); // transform: rotate(-90deg);
} }
background: black;
.footer { .footer {
position: fixed; position: fixed;
bottom: 0px; bottom: 0px;

@ -1,5 +1,5 @@
import React, { useState, useRef, useEffect } from "react"; import React, { useState, useRef, useEffect } from "react";
import {useHistory} from 'react-router-dom'; import { useHistory } from "react-router-dom";
import Navbar from "../../../components/Navbar"; import Navbar from "../../../components/Navbar";
import Footer from "../../Home/Footer"; import Footer from "../../Home/Footer";
import Timer from "../../../components/Timer"; import Timer from "../../../components/Timer";
@ -8,16 +8,16 @@ import { Link } from "react-router-dom";
import arrow from "../../../assets/icons/dropdown.png"; import arrow from "../../../assets/icons/dropdown.png";
import arrowLeft from "../../../assets/icons/arrow-left.png"; import arrowLeft from "../../../assets/icons/arrow-left.png";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { user } from "../../../redux/actions"; import { user } from "../../../redux/actions";
import _ from "lodash";
interface SignUpFields { interface SignUpFields {
cellphone?: String; cellphone?: String;
otp?: String; otp?: String;
} }
function SignUp({ sendOtp, sendPhoneNumber, loginFlag }: any) { function SignUp({ sendOtp, sendPhoneNumber, loginFlag, theme }: any) {
const [level, setLevel] = useState("phonenumber"); const [level, setLevel] = useState("phonenumber");
const [signUpFields, setSignUpFiels] = useState<SignUpFields | undefined>( const [signUpFields, setSignUpFiels] = useState<SignUpFields | undefined>(
undefined undefined
@ -86,12 +86,20 @@ function SignUp({ sendOtp, sendPhoneNumber, loginFlag }: any) {
useEffect(() => { useEffect(() => {
if (loginFlag) { if (loginFlag) {
history.push('/'); history.push("/");
} }
}, [loginFlag]); }, [loginFlag]);
const light = theme === "light";
return ( return (
<div className="signup d-flex flex-column align-items-center justify-content-center"> <div
className={_.join(
[
"signup d-flex flex-column align-items-center justify-content-center",
light ? "signup__light" : "signup__dark",
],
" "
)}
>
<Navbar /> <Navbar />
{level === "phonenumber" && ( {level === "phonenumber" && (
<section className="d-flex flex-column"> <section className="d-flex flex-column">
@ -167,7 +175,10 @@ function SignUp({ sendOtp, sendPhoneNumber, loginFlag }: any) {
ارسال مجدد کد در <Timer seconds={60} refresh={setResend} /> دیگر ارسال مجدد کد در <Timer seconds={60} refresh={setResend} /> دیگر
</p> </p>
) : ( ) : (
<p className="signup__info d-flex justify-content-center" onClick={() => checkPhoneNumber()}> <p
className="signup__info d-flex justify-content-center"
onClick={() => checkPhoneNumber()}
>
دوباره ارسال کنید دوباره ارسال کنید
</p> </p>
)} )}
@ -178,9 +189,12 @@ function SignUp({ sendOtp, sendPhoneNumber, loginFlag }: any) {
); );
} }
export default connect((state : any) => ({ export default connect(
(state: any) => ({
loginFlag: state.user.setLogin, loginFlag: state.user.setLogin,
}), { }),
{
sendOtp: user.otp_login, sendOtp: user.otp_login,
sendPhoneNumber: user.otp, sendPhoneNumber: user.otp,
})(SignUp); }
)(SignUp);

@ -2,17 +2,23 @@ import React, {useState, useEffect} from 'react';
import SignUp from './SignUp/index'; import SignUp from './SignUp/index';
import Profile from './Profile/index'; import Profile from './Profile/index';
import Login from './Login/index'; import Login from './Login/index';
import {connect} from 'react-redux';
export default function Auth(props : any) {
function Auth(props : any) {
const [page, setPage] = useState(props.page); const [page, setPage] = useState(props.page);
useEffect(() => { useEffect(() => {
setPage(() => props.page); setPage(() => props.page);
},[props.page]); },[props.page]);
return ( return (
<> <>
{ page === 'signup' && <SignUp /> } { page === 'signup' && <SignUp theme={props.theme} /> }
{ page === 'login' && <Login setPage={setPage} /> } { page === 'login' && <Login theme={props.theme} setPage={setPage} /> }
{ page === 'profile' && <Profile /> } { page === 'profile' && <Profile theme={props.theme} /> }
</> </>
) )
} }
export default connect((state : any) => ({
theme : state.publicApi.theme,
}))(Auth);

@ -2,6 +2,16 @@
transition: all 0.3s; transition: all 0.3s;
overflow : hidden; overflow : hidden;
border-bottom: 1px solid $gray9; border-bottom: 1px solid $gray9;
&__light{
header{
background-color : white !important;
border: 1px solid $gray9;
}
.lesson__files *{
color: black !important;
}
}
&__active{ &__active{
border-bottom-left-radius: 10px; border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px; border-bottom-right-radius: 10px;

@ -6,6 +6,7 @@ import document from "../../../assets/icons/document.png";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { book, publicApi } from "../../../redux/actions"; import { book, publicApi } from "../../../redux/actions";
import location from "../../../util/location"; import location from "../../../util/location";
import _ from "lodash";
function Lesson({ function Lesson({
toggle, toggle,
@ -13,6 +14,7 @@ function Lesson({
activeCategory, activeCategory,
realCategories, realCategories,
vodDuration, vodDuration,
theme,
}: any) { }: any) {
const [selectedLesson, setSelectedLesson] = useState(null); const [selectedLesson, setSelectedLesson] = useState(null);
const duration = (value: number) => { const duration = (value: number) => {
@ -22,10 +24,20 @@ function Lesson({
}; };
const setCategory = (catId: any, videoId: any) => { const setCategory = (catId: any, videoId: any) => {
localStorage.removeItem("bookId"); localStorage.removeItem("bookId");
localStorage.setItem("category", location.getId() + "," + catId + "," + videoId); localStorage.setItem(
"category",
location.getId() + "," + catId + "," + videoId
);
}; };
const light = theme === "light";
return ( return (
<div className="lesson d-flex flex-column"> <div
className={_.join([
"lesson d-flex flex-column",
light ? "lesson__light" : "lesson__dark",
], " ")}
>
<header <header
className="desktop justify-content-between align-items-center" className="desktop justify-content-between align-items-center"
onClick={() => toggle(lesson[0].categoryId)} onClick={() => toggle(lesson[0].categoryId)}
@ -110,13 +122,20 @@ function Lesson({
</div> </div>
<ul className="d-flex"> <ul className="d-flex">
<li>{data.type !== "pdf" && duration(data.duration)}</li> <li>{data.type !== "pdf" && duration(data.duration)}</li>
<Link to={"/video/"+ data.id} onClick={() => setCategory(lesson[0].categoryId, data.name)}> <Link
to={"/video/" + data.id}
onClick={() => setCategory(lesson[0].categoryId, data.name)}
>
<li>{"مشاهده"}</li> <li>{"مشاهده"}</li>
</Link> </Link>
{/* <li>{data.download ? "دانلود" : <img src={lock} alt="" />}</li> */} {/* <li>{data.download ? "دانلود" : <img src={lock} alt="" />}</li> */}
</ul> </ul>
</li> </li>
{selectedLesson === data.id && <p style={{ fontSize: 11, padding: "10px 60px 10px 20px" }}>توضیحات مرتبط با این درس</p>} {selectedLesson === data.id && (
<p style={{ fontSize: 11, padding: "10px 60px 10px 20px" }}>
توضیحات مرتبط با این درس
</p>
)}
</div> </div>
))} ))}
</ul> </ul>

@ -1,6 +1,15 @@
@import './Lesson/index.scss'; @import "./Lesson/index.scss";
.course { .course {
&__light {
.course__options--rate {
color: black;
}
.course__options--button {
background-color: white !important;
color: black;
}
}
&__header { &__header {
padding: 30px 0px 45px; padding: 30px 0px 45px;
border-bottom: 2px solid $gray5; border-bottom: 2px solid $gray5;
@ -78,7 +87,6 @@
} }
} }
@media screen and (min-width: 1441px) { @media screen and (min-width: 1441px) {
.course { .course {
main { main {
@ -149,7 +157,6 @@
margin-top: 15px; margin-top: 15px;
font-size: 20px; font-size: 20px;
} }
} }
&--button { &--button {
width: 315px; width: 315px;
@ -191,7 +198,7 @@
font-size: calc(100vw / 50); font-size: calc(100vw / 50);
} }
p { p {
font-size: calc(100vw / 100);; font-size: calc(100vw / 100);
} }
.course-info-items { .course-info-items {
width: 45%; width: 45%;
@ -235,7 +242,6 @@
margin-top: 5px; margin-top: 5px;
font-size: calc(100vw / 80); font-size: calc(100vw / 80);
} }
} }
&--button { &--button {
width: 70%; width: 70%;
@ -326,7 +332,6 @@
margin-top: 5px; margin-top: 5px;
font-size: calc(100vw / 40); font-size: calc(100vw / 40);
} }
} }
&--button { &--button {
width: 48%; width: 48%;
@ -426,7 +431,6 @@
margin-top: 5px; margin-top: 5px;
font-size: calc(100vw / 40); font-size: calc(100vw / 40);
} }
} }
&--button { &--button {
width: 48%; width: 48%;

@ -14,8 +14,9 @@ import { connect } from "react-redux";
import { publicApi } from "../../redux/actions"; import { publicApi } from "../../redux/actions";
import scroll from "../../util/scroll"; import scroll from "../../util/scroll";
import Loader from "../../components/Loader"; import Loader from "../../components/Loader";
import _ from "lodash";
function Course({ getInfo, info, categories, loading }: any) { function Course({ getInfo, info, categories, loading, theme }: any) {
const [links, setLinks] = useState([ const [links, setLinks] = useState([
{ link: "/", name: "صفحه اصلی" }, { link: "/", name: "صفحه اصلی" },
{ link: "/courses", name: "دورهها" }, { link: "/courses", name: "دورهها" },
@ -25,7 +26,7 @@ function Course({ getInfo, info, categories, loading }: any) {
useEffect(() => { useEffect(() => {
scroll.goToTop(); scroll.goToTop();
getInfo({ getInfo({
bookId: location.getId() bookId: location.getId(),
}); });
}, []); }, []);
@ -36,9 +37,16 @@ function Course({ getInfo, info, categories, loading }: any) {
localStorage.setItem("bookId", location.getId()); localStorage.setItem("bookId", location.getId());
localStorage.removeItem("category"); localStorage.removeItem("category");
}; };
const light = theme === "light";
return ( return (
<div <div
className="course main d-flex flex-column" className={_.join(
[
"course main d-flex flex-column",
light ? "course__light" : "course__dark",
],
" "
)}
style={{ filter: loading ? "blur(8px)" : "" }} style={{ filter: loading ? "blur(8px)" : "" }}
> >
<Navbar /> <Navbar />
@ -59,7 +67,10 @@ function Course({ getInfo, info, categories, loading }: any) {
<i>{info?.vodTeacher}</i> <i>{info?.vodTeacher}</i>
</div> </div>
<div className="d-flex " style={{ minWidth: 150 }}> <div className="d-flex " style={{ minWidth: 150 }}>
<div className="course-info-items d-flex align-items-center justify-content-around" style={{ minWidth: 150 }}> <div
className="course-info-items d-flex align-items-center justify-content-around"
style={{ minWidth: 150 }}
>
<img src={slide} alt="" /> <img src={slide} alt="" />
<div className="d-flex flex-column" style={{ minWidth: 100 }}> <div className="d-flex flex-column" style={{ minWidth: 100 }}>
<i>{info?.vodDuration} ساعت درس </i> <i>{info?.vodDuration} ساعت درس </i>
@ -156,7 +167,7 @@ function Course({ getInfo, info, categories, loading }: any) {
{/* <p>در این قسمت شاید یک متن جهت زیباسازی قرار بگیرد </p> */} {/* <p>در این قسمت شاید یک متن جهت زیباسازی قرار بگیرد </p> */}
</header> </header>
{categories?.map((lesson: any, i: any) => ( {categories?.map((lesson: any, i: any) => (
<Lesson key={i} lesson={lesson} /> <Lesson key={i} lesson={lesson} theme={theme} />
))} ))}
</section> </section>
</main> </main>
@ -175,6 +186,7 @@ export default connect(
info: state.publicApi.bookInfo, info: state.publicApi.bookInfo,
categories: state.publicApi.categories, categories: state.publicApi.categories,
loading: state.publicApi.loading, loading: state.publicApi.loading,
theme: state.publicApi.theme,
}), }),
{ getInfo: publicApi.bookInfo } { getInfo: publicApi.bookInfo }
)(Course); )(Course);

@ -1,4 +1,17 @@
.faq { .faq {
&__light{
.faq{
&__list{
li{
background-color: white !important;
border: 1px solid black !important;
p{
color: black !important;
}
}
}
}
}
header { header {
width: 100%; width: 100%;
margin: 0px auto; margin: 0px auto;

@ -7,6 +7,7 @@ import whiteDropdown from "../../assets/icons/white-dropdown.png";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { faq } from "../../redux/actions"; import { faq } from "../../redux/actions";
import scroll from "../../util/scroll.js"; import scroll from "../../util/scroll.js";
import _ from "lodash";
function Faq({ function Faq({
list, list,
@ -15,13 +16,21 @@ function Faq({
searchFaq, searchFaq,
searchResult, searchResult,
search, search,
theme,
}: any) { }: any) {
useEffect(() => { useEffect(() => {
getList(); getList();
scroll.goToTop(); scroll.goToTop();
}, []); }, []);
const light = theme === "light";
return ( return (
<div className="faq main d-flex flex-column"> <div
className={_.join([
"faq main d-flex flex-column",
light ? "faq__light" : "faq__dark",
], " ")}
>
<Navbar /> <Navbar />
<main className="d-flex flex-column"> <main className="d-flex flex-column">
<header className="d-flex flex-column"> <header className="d-flex flex-column">
@ -97,6 +106,7 @@ export default connect(
list: state.faq.list, list: state.faq.list,
searchResult: state.faq.searchResult, searchResult: state.faq.searchResult,
search: state.faq.search, search: state.faq.search,
theme: state.publicApi.theme,
}), }),
{ getList: faq.list, selectFaq: faq.selectFaq, searchFaq: faq.searchFaq } { getList: faq.list, selectFaq: faq.selectFaq, searchFaq: faq.searchFaq }
)(Faq); )(Faq);

@ -9,6 +9,12 @@
h1 { h1 {
font-family: numeralBold; font-family: numeralBold;
} }
&__light {
h1 {
color: black !important;
}
}
&__figure { &__figure {
&--screen { &--screen {
width: 220px; width: 220px;
@ -25,7 +31,8 @@
padding: 10px; padding: 10px;
background-color: black; background-color: black;
border-radius: 10px; border-radius: 10px;
h2,p{ h2,
p {
margin: 0px; margin: 0px;
margin-right: 5px; margin-right: 5px;
} }
@ -71,7 +78,8 @@
padding: 10px; padding: 10px;
background-color: black; background-color: black;
border-radius: 10px; border-radius: 10px;
h2,p{ h2,
p {
margin: 0px; margin: 0px;
margin-right: 5px; margin-right: 5px;
} }
@ -110,5 +118,4 @@
} }
} }
} }
} }

@ -1,13 +1,21 @@
import React from "react"; import React from "react";
import ar from "../../../assets/icons/ar.png"; import ar from "../../../assets/icons/ar.png";
import download from "../../../assets/icons/download.png"; import download from "../../../assets/icons/download.png";
import _ from "lodash";
export default function AppDownload() { export default function AppDownload(props: any) {
const { theme } = props;
return ( return (
<section className="app-download desktop justify-content-between align-items-center"> <section
<h1> className={_.join(
دریافت اپلیکیشن دانوین [
</h1> "app-download desktop justify-content-between align-items-center",
theme === "light" ? "app-download__light" : "app-download__dark",
],
" "
)}
>
<h1>دریافت اپلیکیشن دانوین</h1>
<figure className="app-download__figure d-flex flex-column align-items-center"> <figure className="app-download__figure d-flex flex-column align-items-center">
<div className="app-download__figure--screen"></div> <div className="app-download__figure--screen"></div>
<div className="app-download__figure--details d-flex justify-content-between align-items-center"> <div className="app-download__figure--details d-flex justify-content-between align-items-center">

@ -11,6 +11,7 @@
&__container{ &__container{
width: 100%; width: 100%;
margin : 0px auto; margin : 0px auto;
padding: 0px 10px;
p{ p{
margin: 0px; margin: 0px;
color: $gray; color: $gray;

@ -1,9 +1,10 @@
import React, { useEffect } from "react"; import React, { useEffect } from "react";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import scroll from "../../../util/scroll"; import scroll from "../../../util/scroll";
import {connect} from 'react-redux';
import _ from 'lodash'; import _ from 'lodash';
export default function Footer(props: any) { function Footer(props: any) {
const { links, theme } = props; const { links, theme } = props;
useEffect(() => { useEffect(() => {
scroll.goToTop() scroll.goToTop()
@ -30,6 +31,10 @@ export default function Footer(props: any) {
); );
} }
export default connect((state : any) => ({
theme : state.publicApi.theme,
}))(Footer)
Footer.defaultProps = { Footer.defaultProps = {
links: [ links: [
{ name: "تعرفهها", link: "/subscribe" }, { name: "تعرفهها", link: "/subscribe" },

@ -76,8 +76,8 @@ function Home({
/> />
<Books list={gradeFilterBooks ? gradeFilterBooks : courseList} theme={theme} /> <Books list={gradeFilterBooks ? gradeFilterBooks : courseList} theme={theme} />
<Blogs theme={theme} /> <Blogs theme={theme} />
<AppDownload /> <AppDownload theme={theme} />
<Footer theme={theme} /> <Footer />
</div> </div>
{vocal ? ( {vocal ? (
<Vocal setVocal={setVocal} setInputValue={setInputValue} /> <Vocal setVocal={setVocal} setInputValue={setInputValue} />

@ -5,13 +5,15 @@
border-radius: 10px; border-radius: 10px;
cursor: pointer; cursor: pointer;
transition: all 0.5s; transition: all 0.5s;
&__name{ &__name{
border-top-right-radius: 10px; border-top-right-radius: 10px;
border-bottom-right-radius: 10px; border-bottom-right-radius: 10px;
h2{ h2{
color: white !important; color: white;
margin-bottom: 0px; margin-bottom: 0px;
} }
} }
&__factor{ &__factor{
border-top-left-radius: 10px; border-top-left-radius: 10px;
@ -62,6 +64,18 @@
background-color: rgba(255, 255, 255, 0.18); background-color: rgba(255, 255, 255, 0.18);
} }
} }
&__light{
h2{
color: black !important;
}
.subscribe-radio{
&-active{
h2{
color: white !important;
}
}
}
}
} }
@media screen and (min-width: 1441px) { @media screen and (min-width: 1441px) {

@ -4,25 +4,28 @@ import CircleRoundedIcon from "@mui/icons-material/CircleRounded";
import RadioButtonUncheckedRoundedIcon from "@mui/icons-material/RadioButtonUncheckedRounded"; import RadioButtonUncheckedRoundedIcon from "@mui/icons-material/RadioButtonUncheckedRounded";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { product, userProduct } from "../../../redux/actions"; import { product, userProduct } from "../../../redux/actions";
import _ from "lodash";
function SubscribeRadio({ data, selectedVOD, selectVOD }: any) { function SubscribeRadio({ data, selectedVOD, selectVOD, theme }: any) {
const submitVOD = (value: any) => { const submitVOD = (value: any) => {
if (selectedVOD?.id === data.id) { if (selectedVOD?.id === data.id) {
selectVOD(null); selectVOD(null);
} else { } else {
selectVOD(data) selectVOD(data);
}
} }
};
const light = theme === "light";
return ( return (
<div <div
className={ className={_.join(
"subscribe-radio d-flex" + [
" " + "subscribe-radio d-flex",
(selectedVOD?.id === data.id ? "subscribe-radio-active" : "") selectedVOD?.id === data.id ? "subscribe-radio-active" : "",
} light ? "subscribe-radio__light" : "subscribe-radio__dark",
onClick={() => ],
submitVOD(data) " "
} )}
onClick={() => submitVOD(data)}
> >
<div className="subscribe-radio__name d-flex align-items-center"> <div className="subscribe-radio__name d-flex align-items-center">
<CustomCheckbox <CustomCheckbox

@ -7,26 +7,50 @@ import { connect } from "react-redux";
import { product, userFactor } from "../../redux/actions"; import { product, userFactor } from "../../redux/actions";
import scroll from "../../util/scroll"; import scroll from "../../util/scroll";
import Loader from "../../components/Loader"; import Loader from "../../components/Loader";
import _ from "lodash";
function Subscription({ listVOD, getList, loading, selectedVOD, payment, verify }: any) { function Subscription({
listVOD,
getList,
loading,
selectedVOD,
payment,
verify,
theme,
}: any) {
useEffect(() => { useEffect(() => {
getList(); getList();
scroll.goToTop(); scroll.goToTop();
}, []); }, []);
const light = theme === "light";
return ( return (
<div className={"subscription main d-flex flex-column"}> <div
className={_.join(
[
"subscription main d-flex flex-column",
],
" "
)}
>
<Navbar /> <Navbar />
<main className={"d-flex flex-column" + " " + (loading && "blur")}> <main className={"d-flex flex-column" + " " + (loading && "blur")}>
<h1>خرید اشتراک دانوین</h1> <h1>خرید اشتراک دانوین</h1>
<p> <p>
اینجا هم برای هر کتاب امکان خرید اشتراک جداگانه هست و هم اشتراک های مدت دار. با خرید اشتراک های مدت دار دانوین می تونید در هزینه هاتون صرفه جویی کنید. اینجا هم برای هر کتاب امکان خرید اشتراک جداگانه هست و هم اشتراک های
مدت دار. با خرید اشتراک های مدت دار دانوین می تونید در هزینه هاتون
صرفه جویی کنید.
</p> </p>
{listVOD?.map((subscribe: any, i: any) => ( {listVOD?.map((subscribe: any, i: any) => (
<SubscribeRadio data={subscribe} key={i} /> <SubscribeRadio theme={theme} data={subscribe} key={i} />
))} ))}
<DiscountCode /> <DiscountCode />
<div className="d-flex justify-content-end py-4"> <div className="d-flex justify-content-end py-4">
<button className="submit submit-large" onClick={() => payment({ productId: selectedVOD.id })}>تایید و پرداخت</button> <button
className="submit submit-large"
onClick={() => payment({ productId: selectedVOD.id })}
>
تایید و پرداخت
</button>
</div> </div>
</main> </main>
<Footer /> <Footer />
@ -43,7 +67,8 @@ export default connect(
(state: any) => ({ (state: any) => ({
listVOD: state.product.listVOD, listVOD: state.product.listVOD,
loading: state.product.loading, loading: state.product.loading,
selectedVOD: state.product.selectedVOD selectedVOD: state.product.selectedVOD,
theme: state.publicApi.theme,
}), }),
{ {
getList: product.listVOD, getList: product.listVOD,

@ -2,7 +2,8 @@ import React from "react";
import Avatar from "@mui/material/Avatar"; import Avatar from "@mui/material/Avatar";
import user3 from "../../../assets/images/user3.png"; import user3 from "../../../assets/images/user3.png";
export default function AddComment() { export default function AddComment(props : any) {
const { theme } = props;
return ( return (
<> <>
<Avatar style={{ width: 60, height: 60, marginLeft: 10 }} /> <Avatar style={{ width: 60, height: 60, marginLeft: 10 }} />

@ -1,6 +1,20 @@
.lesson-playlist{ .lesson-playlist{
width: 100%; width: 100%;
padding-bottom : 10px; padding-bottom : 10px;
&__light{
.lesson-playlist{
h3{
background-color : inherit !important;
border: 1px solid $gray9 !important;
}
&__item{
*{
color: black !important;
}
}
}
}
header{ header{
background-color: inherit !important; background-color: inherit !important;
margin-bottom: 5px; margin-bottom: 5px;

@ -2,6 +2,7 @@ import React, { useEffect } from "react";
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"; import { Link } from "react-router-dom";
import _ from "lodash";
function LessonPlayList({ function LessonPlayList({
category, category,
@ -10,6 +11,7 @@ function LessonPlayList({
catergories, catergories,
realCategories, realCategories,
vods, vods,
theme,
}: any) { }: any) {
const bookId = localStorage.getItem("bookId"); const bookId = localStorage.getItem("bookId");
useEffect(() => { useEffect(() => {
@ -20,23 +22,32 @@ function LessonPlayList({
) 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));
if (elementHeight * (Number(index) + 1) > listHeight) { if (elementHeight * (Number(index) + 1) > listHeight) {
list.scrollTo(0, (elementHeight * (Number(index) + 1)) + elementHeight); list.scrollTo(0, elementHeight * (Number(index) + 1) + elementHeight);
} }
localStorage.removeItem("scroll-list"); localStorage.removeItem("scroll-list");
} }
}, [vods]); }, [vods]);
const light = theme === "light";
return ( return (
<> <>
{ {
<div className="lesson-playlist d-flex flex-column"> <div
className={_.join(
[
"lesson-playlist d-flex flex-column",
light ? "lesson-playlist__light" : "lesson-playlist__dark",
],
" "
)}
>
{bookId && ( {bookId && (
<header> <header>
<h3> <h3>

@ -1,9 +1,36 @@
@import './Attachments/index.scss'; @import "./Attachments/index.scss";
@import './Book/index.scss'; @import "./Book/index.scss";
@import './Comment/index.scss'; @import "./Comment/index.scss";
@import './LessonPlayList/index.scss'; @import "./LessonPlayList/index.scss";
.video-tube {
&__light {
h1,
p {
color: black !important;
}
.video-tube { .video-tube {
&__content {
&--comments {
color: black !important;
}
&--addComment {
textarea {
background-color: white !important;
color: black !important;
}
}
}
&__sidebar{
header{
background-color: white !important;
*{
color: black !important;
}
}
}
}
}
&__content { &__content {
margin-left: 15px; margin-left: 15px;
@ -550,4 +577,3 @@
} }
} }
} }

@ -10,6 +10,7 @@ import Video from "../../components/JolPlayer";
import listIcon from "../../assets/icons/list.png"; import listIcon from "../../assets/icons/list.png";
import { connect } from "react-redux"; import { connect } from "react-redux";
import _ from "lodash";
import scroll from "../../util/scroll.js"; import scroll from "../../util/scroll.js";
import location from "../../util/location.js"; import location from "../../util/location.js";
import { book, publicApi } from "../../redux/actions"; import { book, publicApi } from "../../redux/actions";
@ -24,6 +25,7 @@ function VodTube({
categories, categories,
setVideoActive, setVideoActive,
allBooks, allBooks,
theme,
}: any) { }: any) {
const videoListTag = useRef(null); const videoListTag = useRef(null);
useEffect(() => { useEffect(() => {
@ -43,10 +45,17 @@ function VodTube({
} }
}, [allBooks]); }, [allBooks]);
const light = theme === "light";
return ( return (
<> <>
<div <div
className="video-tube main d-flex flex-column" className={_.join(
[
"video-tube main d-flex flex-column",
light ? "video-tube__light" : "video-tube__dark",
],
" "
)}
style={{ filter: loading ? "blur(8px)" : "" }} style={{ filter: loading ? "blur(8px)" : "" }}
> >
<Navbar /> <Navbar />
@ -76,7 +85,7 @@ function VodTube({
</div> </div>
</section> </section>
<section className="desktop video-tube__content--addComment"> <section className="desktop video-tube__content--addComment">
<AddComment /> <AddComment theme={theme} />
</section> </section>
</div> </div>
<div className="video-tube__sidebar d-flex flex-column"> <div className="video-tube__sidebar d-flex flex-column">
@ -98,10 +107,10 @@ function VodTube({
> >
{localStorage.getItem("bookId") {localStorage.getItem("bookId")
? categories?.map((video: any, i: any) => ( ? categories?.map((video: any, i: any) => (
<LessonPlayList category={video} key={i} /> <LessonPlayList theme={theme} category={video} key={i} />
)) ))
: info?.vods.map((video: any, i: any) => ( : info?.vods.map((video: any, i: any) => (
<LessonPlayList category={video} key={i} /> <LessonPlayList theme={theme} category={video} key={i} />
))} ))}
</div> </div>
</section> </section>
@ -165,6 +174,7 @@ export default connect(
loading: state.publicApi.loading, loading: state.publicApi.loading,
categories: state.publicApi.categories, categories: state.publicApi.categories,
allBooks: state.publicApi.bookInfo?.vods, allBooks: state.publicApi.bookInfo?.vods,
theme: state.publicApi.theme,
}), }),
{ {
getInfo: publicApi.bookInfo, getInfo: publicApi.bookInfo,

Loading…
Cancel
Save