reza fixed some bugs

master
RezaAshrafi77 3 years ago
parent aea8e34cbd
commit 6401a3d9bf
  1. 2
      public/index.html
  2. 26
      src/components/Navbar/index.scss
  3. 6
      src/components/Navbar/index.tsx
  4. 30
      src/components/PrivateRouter/index.js
  5. 8
      src/components/Timer/index.css
  6. 85
      src/components/Timer/index.js
  7. 7
      src/redux/actions-type/book.tsx
  8. 3
      src/redux/actions/book.tsx
  9. 21
      src/redux/reducers/book.tsx
  10. 53
      src/router.js
  11. 55
      src/router.tsx
  12. 5
      src/views/Auth/Login/index.scss
  13. 21
      src/views/Auth/Login/index.tsx
  14. 10
      src/views/Auth/SignUp/index.scss
  15. 56
      src/views/Auth/SignUp/index.tsx
  16. 5
      src/views/Auth/index.tsx
  17. 2
      src/views/Home/Books/Book/index.tsx
  18. 12
      src/views/Home/Books/index.tsx
  19. 4
      src/views/Subscription/DiscountCode/index.scss
  20. 13
      src/views/Subscription/SubscribeRadio/index.scss
  21. 16
      src/views/Subscription/SubscribeRadio/index.tsx
  22. 12
      src/views/Subscription/index.scss
  23. 2
      src/views/VideoTube/Attachments/index.scss
  24. 4
      src/views/VideoTube/Book/index.scss
  25. 3
      src/views/VideoTube/LessonPlayList/index.scss
  26. 23
      src/views/VideoTube/LessonPlayList/index.tsx
  27. 18
      src/views/VideoTube/index.scss

@ -29,7 +29,7 @@
work correctly both with client-side routing and a non-root public URL. work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`. Learn how to configure a non-root public URL by running `npm run build`.
--> -->
<title>React App</title> <title>Danovin VOD</title>
</head> </head>
<body> <body>
<noscript>You need to enable JavaScript to run this app.</noscript> <noscript>You need to enable JavaScript to run this app.</noscript>

@ -13,6 +13,18 @@
a{ a{
color: white; color: white;
} }
&--buttons{
li{
text-align: center;
padding: 6px 0px;
border-radius: 7px;
min-width : 130px;
font-family: numeralLight;
a{
margin: 0px auto;
}
}
}
} }
&___share{ &___share{
background-color: #46454A; background-color: #46454A;
@ -41,12 +53,7 @@
} }
&--buttons{ &--buttons{
li{ li{
padding: 6px; font-size: 18px;
border-radius: 7px;
min-width : 100px;
text-align: center;
font-size: 14px;
font-family: numeralLight;
} }
} }
} }
@ -79,13 +86,8 @@
} }
&--buttons{ &--buttons{
li{ li{
padding: 6px; font-size: calc(100vw / 100);
border-radius: 7px;
min-width: 100px; min-width: 100px;
text-align: center;
font-size: calc(100vw / 95);
font-family: numeralLight;
} }
} }
} }

@ -32,7 +32,7 @@ export default function Navbar(props: any) {
const { page } = props; const { page } = props;
const toggleDrawer = (anchor: any, open: any) => (event: any) => { const toggleDrawer = (anchor: any, open: any) => (event: any) => {
console.log('on'); console.log("on");
if ( if (
event && event &&
event.type === "keydown" && event.type === "keydown" &&
@ -59,6 +59,8 @@ export default function Navbar(props: any) {
/> />
</div> </div>
); );
const userStatus = proxy.status();
return ( return (
<nav className="nav align-items-center justify-content-center"> <nav className="nav align-items-center justify-content-center">
<div className="nav__container d-flex align-items-center justify-content-between"> <div className="nav__container d-flex align-items-center justify-content-between">
@ -83,9 +85,11 @@ export default function Navbar(props: any) {
<li className="nav___share desktop"> <li className="nav___share desktop">
<Link to="/subscribe">خرید اشتراک</Link> <Link to="/subscribe">خرید اشتراک</Link>
</li> </li>
{!userStatus && (
<li className="nav___login"> <li className="nav___login">
<Link to="/login">ورود</Link> <Link to="/login">ورود</Link>
</li> </li>
)}
</ul> </ul>
</div> </div>
<SwipeableDrawer <SwipeableDrawer

@ -0,0 +1,30 @@
import React, { Component } from "react";
import { Route, useHistory, Redirect } from "react-router-dom";
import { connect } from "react-redux";
const PrivateRouter = ({
component: Component,
restricted,
status,
...rest
}) => {
return (
<Route
{...rest}
render={(props) =>
1 ? (
<Component {...props} />
) : (
<Redirect to="/login" />
)
}
/>
);
};
export default connect(
(state) => ({
status: state.publicApi.status,
}),
{}
)(PrivateRouter);

@ -0,0 +1,8 @@
.timer {
flex-direction: row;
direction: rtl !important;
margin-right: 10px;
margin-left: 10px;
color: #6cbe44;
font-family: numeralLight;
}

@ -0,0 +1,85 @@
import { Component } from "react";
import "./index.css";
const maxDesktopSize = 1250;
const maxMobileSize = 550;
const fontSize = {
desktop: {
div: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 95,
},
mobile: {
div: window.innerWidth > maxMobileSize ? 12 : window.innerWidth / 30,
},
};
export default class Timer extends Component {
constructor(props) {
super(props);
this.state = {
time: {
h: 0,
m: 0,
s: 0,
},
seconds : props.seconds,
flag: true,
};
this.timer = 0;
this.startTimer = this.startTimer.bind(this);
this.countDown = this.countDown.bind(this);
}
secondsToTime(secs) {
let hours = Math.floor(secs / (60 * 60));
let divisor_for_minutes = secs % (60 * 60);
let minutes = Math.floor(divisor_for_minutes / 60);
let divisor_for_seconds = divisor_for_minutes % 60;
let seconds = Math.ceil(divisor_for_seconds);
let obj = {
h: hours,
m: minutes,
s: seconds,
};
return obj;
}
componentDidMount() {
this.startTimer();
let timeLeftVar = this.secondsToTime(this.state.seconds);
this.setState({ time: timeLeftVar });
}
startTimer() {
if (this.timer === 0 && this.state.seconds > 0) {
this.timer = setInterval(this.countDown, 1000);
}
}
countDown = async () => {
// Remove one second, set state so a re-render happens.
let seconds = this.state.seconds - 1;
this.setState({
time: this.secondsToTime(seconds),
seconds: seconds,
});
if (seconds === 0) {
this.props.refresh(true);
}
};
componentWillUnmount() {
clearInterval(this.timer);
}
render() {
return (
<>
<div className="timer">
{this.state.time ? this.state.time.m : ''}:{this.state.time ? this.state.time.s : ''}
</div>
</>
);
}
}

@ -13,6 +13,11 @@ interface setLessonActive{
data : any data : any
} }
interface setVideoActive{
type : "book/video/active"
data : any
}
interface error{ interface error{
type : "book/error" type : "book/error"
data : undefined data : undefined
@ -24,6 +29,6 @@ interface loading{
} }
type BookAction = list | info | setLessonActive | loading | error; type BookAction = list | info | setVideoActive | setLessonActive | loading | error;
export default BookAction; export default BookAction;

@ -12,6 +12,8 @@ const book = {
setLessonActive: (data: undefined) => async (dispatch: Dispatch) => setLessonActive: (data: undefined) => async (dispatch: Dispatch) =>
await dispatch({ type: "book/lesson/active", data: data }), await dispatch({ type: "book/lesson/active", data: data }),
setVideoActive: (data: undefined) => async (dispatch: Dispatch) =>
await dispatch({ type: "book/video/active", data: data }),
// update: // update:
// (data = {}, data2 = {}) => // (data = {}, data2 = {}) =>
// async (dispatch : Dispatch) => { // async (dispatch : Dispatch) => {
@ -36,7 +38,6 @@ const book = {
// filterBook: (data) => async (dispatch) => { // filterBook: (data) => async (dispatch) => {
// dispatch({ type: "book/filter", data: data }); // dispatch({ type: "book/filter", data: data });
// }, // },
}; };
export default book; export default book;

@ -202,19 +202,19 @@ const initialState = {
files: [ files: [
{ {
id : 0, id : 0,
name: "ماهی های پرورشی و فواید آن", name: "ماهی های پرورشی و فواید آن ی",
src: sea, src: sea,
text: "لورم اپیوسرم یک متن آزمایشی است که برای", text: "لورم اپیوسرم یک متن آزمایشی است که برای",
}, },
{ {
id : 1, id : 1,
name: "ماهی های پرورشی و فواید آن", name: "ماهی های پرورشی و فواید آن ذ",
src: sea, src: sea,
text: "لورم اپیوسرم یک متن آزمایشی است که برای", text: "لورم اپیوسرم یک متن آزمایشی است که برای",
}, },
{ {
id : 2, id : 2,
name: "ماهی های پرورشی و فواید آن", name: "ماهی های پرورشی و فواید آن ن",
src: sea, src: sea,
text: "لورم اپیوسرم یک متن آزمایشی است که برای", text: "لورم اپیوسرم یک متن آزمایشی است که برای",
}, },
@ -227,15 +227,15 @@ const initialState = {
{ {
name: "ماهی های پرورشی و فواید آن", name: "ماهی های پرورشی و فواید آن",
src: sea, src: sea,
text: "لورم اپیوسرم یک متن آزمایشی است که برای", text: "لورم اپیوسرم یک متن آزمایشی است که برای س",
}, },
{ {
name: "ماهی های پرورشی و فواید آن", name: "ماهی های پرورشی و فواید آن خ",
src: sea, src: sea,
text: "لورم اپیوسرم یک متن آزمایشی است که برای", text: "لورم اپیوسرم یک متن آزمایشی است که برای",
}, },
{ {
name: "ماهی های پرورشی و فواید آن", name: "ماهی های پرورشی و فواید آن ظ",
src: sea, src: sea,
text: "لورم اپیوسرم یک متن آزمایشی است که برای", text: "لورم اپیوسرم یک متن آزمایشی است که برای",
}, },
@ -270,7 +270,7 @@ const initialState = {
] ]
}, },
selectedVideo : { selectedVideo : {
name: "ماهی های پرورشی و فواید آن", name: "ماهی های پرورشی و فواید آن ی",
src: sea, src: sea,
text: "لورم اپیوسرم یک متن آزمایشی است که برای", text: "لورم اپیوسرم یک متن آزمایشی است که برای",
}, },
@ -349,6 +349,13 @@ export default function book(state = initialState, action: BookAction) {
: { ...item, active: false } : { ...item, active: false }
), ),
}; };
case "book/video/active":
return {
...state,
loading: false,
error: null,
selectedVideo : data,
};
// case "book/update": // case "book/update":
// return { ...state, loading: false, error: null }; // return { ...state, loading: false, error: null };
// case "book/add": // case "book/add":

@ -0,0 +1,53 @@
import "./App.css";
import {
BrowserRouter as Router,
Route,
Switch,
} from "react-router-dom";
import { connect } from "react-redux";
import Auth from "./views/Auth/index";
import Home from "./views/Home/index";
import Course from "./views/Course/index";
import VideoTube from "./views/VideoTube/index";
import Subscription from "./views/Subscription/index";
import Contact from "./views/Contact/index";
import Faq from "./views/Faq/index";
import PrivateRouter from "./components/PrivateRouter/index";
function router({ status }) {
return (
<Router>
<Switch>
<PrivateRouter restricted={false} component={Home} path="/" exact />
<Route exact path={"/sign-up"}>
<Auth page="signup" />
</Route>
<Route exact path={"/login"}>
<Auth page="login" />
</Route>
<Route exact path={"/profile"}>
<Auth page="profile" />
</Route>
<PrivateRouter
restricted={false}
component={Course}
path="/courses/:id"
exact
/>
<PrivateRouter restricted={false} component={VideoTube} path="/video-tube" exact />
<PrivateRouter restricted={false} component={Subscription} path="/subscribe" exact />
<Route exact path={"/contact"}>
<Contact />
</Route>
<Route exact path={"/faq"}>
<Faq />
</Route>
</Switch>
</Router>
);
}
export default connect((state) => ({
status: state.publicApi.status,
}))(router);

@ -1,55 +0,0 @@
import "./App.css";
import {
BrowserRouter as Router,
Route,
Switch,
Redirect,
} from "react-router-dom";
import Auth from './views/Auth/index';
import Home from "./views/Home/index";
import Course from "./views/Course/index";
import VideoTube from "./views/VideoTube/index";
import Subscription from "./views/Subscription/index";
import Contact from "./views/Contact/index";
import Faq from "./views/Faq/index";
function router(){
return (
<Router>
<Switch>
<Route exact path={'/'}>
<Home />
</Route>
<Route exact path={'/sign-up'}>
<Auth page="signup" />
</Route>
<Route exact path={'/login'}>
<Auth page="login" />
</Route>
<Route exact path={'/profile'}>
<Auth page="profile" />
</Route>
<Route exact path={'/courses/:id'}>
<Course />
</Route>
<Route exact path={'/video-tube'}>
<VideoTube />
</Route>
<Route exact path={'/subscribe'}>
<Subscription />
</Route>
<Route exact path={'/contact'}>
<Contact />
</Route>
<Route exact path={'/faq'}>
<Faq />
</Route>
</Switch>
</Router>
);
}
export default router;

@ -35,6 +35,11 @@
bottom: 0px; bottom: 0px;
left: 0px; left: 0px;
} }
&__back{
img{
transform: rotate(-90deg);
}
}
} }
@media screen and (min-width: 1441px) { @media screen and (min-width: 1441px) {

@ -1,4 +1,4 @@
import React, { useState } from "react"; import React, { useState, useRef, useEffect } from "react";
import Navbar from "../../../components/Navbar/index"; import Navbar from "../../../components/Navbar/index";
import Footer from "../../../views/Home/Footer/index"; import Footer from "../../../views/Home/Footer/index";
import Input from "../../../components/Input/index"; import Input from "../../../components/Input/index";
@ -27,20 +27,23 @@ function Login(props: any) {
const onChange = (name: string, value: string) => { const onChange = (name: string, value: string) => {
setSignUpFiels({ ...loginFields, [name]: value }); setSignUpFiels({ ...loginFields, [name]: value });
}; };
const usernameInput = useRef<any>();
const passwordInput = useRef<any>();
useEffect(() => {
}, []);
return ( return (
<div className="login d-flex flex-column align-items-center justify-content-center"> <div className="login d-flex flex-column align-items-center justify-content-center">
<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">
<Link to="/sign-up" className="d-flex align-items-center"> <Link to="/" className="d-flex align-items-center">
{window.innerWidth > 1007 ? ( <div className="desktop align-items-center">
<>
بازگشت به صفحه قبل بازگشت به صفحه قبل
<img src={arrow} /> <img src={arrow} />
</> </div>
) : ( <img className="mobile" src={arrowLeft} alt="" />
<img src={arrowLeft} alt="" />
)}
</Link> </Link>
</div> </div>
<b> <b>
@ -54,6 +57,7 @@ function Login(props: any) {
align="left" align="left"
onInput={onInput.englishAndNumberWithoutSpace} onInput={onInput.englishAndNumberWithoutSpace}
onChange={onChange} onChange={onChange}
ref={usernameInput}
/> />
<Input <Input
name="password" name="password"
@ -61,6 +65,7 @@ function Login(props: any) {
align="left" align="left"
onInput={onInput.englishAndNumberWithoutSpace} onInput={onInput.englishAndNumberWithoutSpace}
onChange={onChange} onChange={onChange}
ref={passwordInput}
/> />
<div className="login__options d-flex justify-content-between align-items-center"> <div className="login__options d-flex justify-content-between align-items-center">
<div className="d-flex align-items-center"> <div className="d-flex align-items-center">

@ -84,6 +84,11 @@
color: white; color: white;
font-size: 13px; font-size: 13px;
} }
.desktop{
img{
transform: rotate(-90deg);
}
}
} }
&__error{ &__error{
margin-top: 10px; margin-top: 10px;
@ -149,6 +154,11 @@
color: white; color: white;
font-size: calc(100vw / 110); font-size: calc(100vw / 110);
} }
.desktop{
img{
transform: rotate(-90deg);
}
}
} }
&__error{ &__error{
margin-top: 10px; margin-top: 10px;

@ -1,6 +1,7 @@
import React, { useState } from "react"; import React, { useState, useRef, useEffect } from "react";
import Navbar from "../../../components/Navbar/index"; import Navbar from "../../../components/Navbar/index";
import Footer from "../../../views/Home/Footer/index"; import Footer from "../../../views/Home/Footer/index";
import Timer from "../../../components/Timer/index";
import onInput from "../../../util/onInput"; import onInput from "../../../util/onInput";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import arrow from "../../../assets/icons/dropdown.png"; import arrow from "../../../assets/icons/dropdown.png";
@ -8,7 +9,7 @@ import arrowLeft from "../../../assets/icons/arrow-left.png";
import "./index.scss"; import "./index.scss";
import { connect, useSelector } from "react-redux"; import { connect } from "react-redux";
import { user } from "../../../redux/actions"; import { user } from "../../../redux/actions";
interface SignUpFields { interface SignUpFields {
@ -16,39 +17,56 @@ interface SignUpFields {
otp?: String; otp?: String;
} }
function SignUp(props: any) {
function SignUp({sendOtp, sendPhoneNumber} : 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
); );
const [error, setError] = useState<string | undefined>(undefined); const [error, setError] = useState<string | undefined>(undefined);
const [resend, setResend] = useState(false);
const onChange = (name: string, value: string) => { const onChange = (name: string, value: string) => {
setSignUpFiels({ ...signUpFields, [name]: value }); setSignUpFiels({ ...signUpFields, [name]: value });
}; };
const submitPhoneNumber = () => { const checkPhoneNumber = () => {
if ( if (
signUpFields?.cellphone?.slice(0, 2) === "09" && signUpFields?.cellphone?.slice(0, 2) === "09" &&
signUpFields?.cellphone.length === 11 signUpFields?.cellphone.length === 11
) { ) {
setLevel("otp"); setLevel("otp");
props.submitOtp({ cellphone: signUpFields?.cellphone }); sendPhoneNumber({ cellphone: signUpFields?.cellphone });
setError(undefined); setError(undefined);
} else { } else {
setError("شماره موبایل خود را چک کنید."); setError("شماره موبایل خود را چک کنید.");
} }
}; };
const submitOTP = () => { const checkOtp = () => {
if (signUpFields?.otp?.length === 4) { if (signUpFields?.otp?.length === 4) {
props.submitOtp({ cellphone: signUpFields?.cellphone }); sendOtp({ cellphone: signUpFields?.cellphone, otp : signUpFields?.otp });
setError(undefined); setError(undefined);
} else { } else {
setError("کد وارد شده را چک کنید."); setError("کد وارد شده را چک کنید.");
} }
}; };
const otpInput = useRef<any | undefined>(undefined);
const numberInput = useRef<any | undefined>(undefined);
useEffect(() => {
numberInput.current.focus();
},[]);
useEffect(() => {
if(level === 'phonenumber'){
numberInput.current.focus();
}else{
otpInput.current.focus();
}
},[level])
return ( return (
<div className="signup d-flex flex-column align-items-center justify-content-center"> <div className="signup d-flex flex-column align-items-center justify-content-center">
<Navbar /> <Navbar />
@ -71,9 +89,10 @@ function SignUp(props: any) {
(target as HTMLInputElement).value (target as HTMLInputElement).value
)) ))
} }
ref={numberInput}
/> />
<span className="signup__error">{error}</span> <span className="signup__error">{error}</span>
<button type="submit" onClick={() => submitPhoneNumber()}> <button type="submit" onClick={() => checkPhoneNumber()}>
{" "} {" "}
ادامه ادامه
</button> </button>
@ -91,14 +110,11 @@ function SignUp(props: any) {
onClick={() => setLevel("phonenumber")} onClick={() => setLevel("phonenumber")}
> >
<Link to="/sign-up" className="d-flex align-items-center"> <Link to="/sign-up" className="d-flex align-items-center">
{window.innerWidth > 1007 ? ( <div className="desktop align-items-center">
<>
بازگشت به صفحه قبل بازگشت به صفحه قبل
<img src={arrow} /> <img src={arrow} />
</> </div>
) : ( <img className="mobile" src={arrowLeft} alt="" />
<img src={arrowLeft} alt="" />
)}
</Link> </Link>
</div> </div>
<b> <b>
@ -116,12 +132,16 @@ function SignUp(props: any) {
(target as HTMLInputElement).value (target as HTMLInputElement).value
)) ))
} }
placeholder={"-- -- -- --"}
ref={otpInput}
/> />
<span className="signup__error">{error}</span> <span className="signup__error">{error}</span>
<button type="submit" onClick={() => submitOTP()}> <button type="submit" onClick={() => checkOtp()}>
ادامه ادامه
</button> </button>
<p className="signup__info"></p> <p className="signup__info d-flex justify-content-center">
ارسال مجدد کد در <Timer seconds={60} refresh={setResend} /> دیگر
</p>
</section> </section>
)} )}
<Footer /> <Footer />
@ -130,6 +150,6 @@ function SignUp(props: any) {
} }
export default connect(() => ({}), { export default connect(() => ({}), {
submitSignUp: user.otp_login, sendOtp: user.otp_login,
submitOtp: user.otp, sendPhoneNumber: user.otp,
})(SignUp); })(SignUp);

@ -1,10 +1,13 @@
import React, {useState} from 'react'; 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';
export default function Auth(props : any) { export default function Auth(props : any) {
const [page, setPage] = useState(props.page); const [page, setPage] = useState(props.page);
useEffect(() => {
setPage(() => props.page);
},[props.page]);
return ( return (
<> <>
{ page === 'signup' && <SignUp /> } { page === 'signup' && <SignUp /> }

@ -6,7 +6,7 @@ export default function Book(props: any) {
const { data } = props; const { data } = props;
return ( return (
<Link to={`/courses/${data.id}`} className="home-books-book d-flex flex-column" draggable={'false'}> <Link to={`/courses/${data.id}`} className="home-books-book d-flex flex-column" draggable={'false'}>
<img src={data.imageUrl} alt={data.name} draggable={'false'} /> <img src={`https://dnvn.ir/api/v1/file/${data.fileIds}`} alt={data.name} draggable={'false'} />
<footer className="d-flex"> <footer className="d-flex">
<div className="home-books-book__info d-flex flex-column"> <div className="home-books-book__info d-flex flex-column">
<h2>{data.name}</h2> <h2>{data.name}</h2>

@ -5,7 +5,7 @@ import Book from "./Book/index";
import { book } from "../../../redux/actions"; import { book } from "../../../redux/actions";
import "./index.scss"; import "./index.scss";
function Books(props: any) { function Books({list, number, getList}: any) {
const slideNumberHandler = () => { const slideNumberHandler = () => {
if (window.innerWidth >= 1440) { if (window.innerWidth >= 1440) {
return 5; return 5;
@ -17,18 +17,16 @@ function Books(props: any) {
return 2; return 2;
} }
}; };
const { number, courses } = props;
const list = useSelector((state: any) => state.book.list);
console.log(list); console.log(list);
useEffect(() => { useEffect(() => {
props.getList(); getList();
}, []); }, []);
return ( return (
<section <section
className="home-books d-flex flex-column" className="home-books d-flex flex-column"
onClick={() => props.getList()} onClick={() => getList()}
> >
{window.innerWidth > 1007 && list?.length > 0 ? ( {window.innerWidth > 1007 && list?.length > 0 ? (
<Carousel <Carousel
@ -44,7 +42,7 @@ function Books(props: any) {
</Carousel> </Carousel>
) : ( ) : (
<div className="home-books__list d-flex"> <div className="home-books__list d-flex">
{courses?.map((item: Object, i: Number) => ( {list?.map((item: Object, i: Number) => (
<Book data={item} key={i} /> <Book data={item} key={i} />
))} ))}
</div> </div>
@ -55,7 +53,7 @@ function Books(props: any) {
export default connect( export default connect(
( state : any) => ({ ( state : any) => ({
book, list : state.book.list,
}), }),
{ getList: book.list } { getList: book.list }
)(Books); )(Books);

@ -29,11 +29,11 @@
@media screen and (min-width : 1441px) { @media screen and (min-width : 1441px) {
.discount-code{ .discount-code{
h3{ h3{
font-size: 20px; font-size: 18px;
} }
input{ input{
padding: 20px 10px 20px 0px; padding: 20px 10px 20px 0px;
width: 200px; width: 250px;
font-size: 14px; font-size: 14px;
&::placeholder{ &::placeholder{
font-size: 10px; font-size: 10px;

@ -3,6 +3,7 @@
border : 1px solid #DFDFDF; border : 1px solid #DFDFDF;
margin-bottom: 15px; margin-bottom: 15px;
border-radius: 10px; border-radius: 10px;
cursor: pointer;
&__name{ &__name{
border-top-right-radius: 10px; border-top-right-radius: 10px;
border-bottom-right-radius: 10px; border-bottom-right-radius: 10px;
@ -67,7 +68,7 @@
@media screen and (min-width: 1441px) { @media screen and (min-width: 1441px) {
.subscribe-radio{ .subscribe-radio{
height: 120px; min-height: 60px;
&__name{ &__name{
flex: 7; flex: 7;
h2{ h2{
@ -77,15 +78,16 @@
} }
&__factor{ &__factor{
flex: 3; flex: 3;
padding-right: 65px;
&--tag{ &--tag{
font-size: 14px; font-size: 11px;
} }
&--off{ &--off{
b{ b{
font-size: 20px; font-size: 16px;
} }
i{ i{
font-size: 12px; font-size: 10px;
} }
} }
&--finalPrice{ &--finalPrice{
@ -102,7 +104,7 @@
@media screen and (min-width: 1008px) and (max-width: 1440px) { @media screen and (min-width: 1008px) and (max-width: 1440px) {
.subscribe-radio{ .subscribe-radio{
min-height: 70px; min-height: 60px;
&__name{ &__name{
flex: 7; flex: 7;
h2{ h2{
@ -112,6 +114,7 @@
} }
&__factor{ &__factor{
flex: 3; flex: 3;
padding-right: 70px;
&--tag{ &--tag{
font-size: calc(100vw / 130); font-size: calc(100vw / 130);
} }

@ -4,7 +4,7 @@ import CustomCheckbox from "../../../components/CustomCheckbox";
import CircleRoundedIcon from "@mui/icons-material/CircleRounded"; 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 {publicApi} from '../../../redux/actions'; import { publicApi } from "../../../redux/actions";
function SubscribeRadio({ data, selectedSubscribe, setSubscribe }: any) { function SubscribeRadio({ data, selectedSubscribe, setSubscribe }: any) {
return ( return (
@ -14,23 +14,25 @@ function SubscribeRadio({ data, selectedSubscribe, setSubscribe }: any) {
" " + " " +
(selectedSubscribe.id === data.id ? "subscribe-radio-active" : "") (selectedSubscribe.id === data.id ? "subscribe-radio-active" : "")
} }
onClick={() =>
selectedSubscribe.id === data.id
? setSubscribe({})
: setSubscribe(data)
}
> >
<div className="subscribe-radio__name d-flex align-items-center"> <div className="subscribe-radio__name d-flex align-items-center">
<CustomCheckbox <CustomCheckbox
icon={ icon={
<RadioButtonUncheckedRoundedIcon <RadioButtonUncheckedRoundedIcon
style={{ color: "#707070", fontSize: 50, padding: 0 }} style={{ color: "#707070", fontSize: 40, padding: 0 }}
/> />
} }
checkedIcon={ checkedIcon={
<CircleRoundedIcon <CircleRoundedIcon
style={{ color: "white", fontSize: 50, padding: 0 }} style={{ color: "white", fontSize: 40, padding: 0 }}
/> />
} }
checked={selectedSubscribe.id === data.id} checked={selectedSubscribe.id === data.id}
onChange={() =>
selectedSubscribe.id === data.id ? setSubscribe({}) : setSubscribe(data)
}
/> />
<h2>{data.name}</h2> <h2>{data.name}</h2>
</div> </div>
@ -60,5 +62,5 @@ export default connect(
(state: any) => ({ (state: any) => ({
selectedSubscripe: state.publicApi.selectedSubscripe, selectedSubscripe: state.publicApi.selectedSubscripe,
}), }),
{setSubscribe : publicApi.setSubscribe,} { setSubscribe: publicApi.setSubscribe }
)(SubscribeRadio); )(SubscribeRadio);

@ -13,13 +13,13 @@
@media screen and (min-width : 1441px) { @media screen and (min-width : 1441px) {
.subscription{ .subscription{
main{ main{
margin-top: 50px; margin-top: 30px;
max-width: 700px; max-width: 700px;
h1{ h1{
font-size: 44px; font-size: 28px;
} }
p{ p{
font-size: 21px; font-size: 16px;
} }
} }
} }
@ -28,14 +28,14 @@
@media screen and (min-width : 1008px) and (max-width : 1440px) { @media screen and (min-width : 1008px) and (max-width : 1440px) {
.subscription{ .subscription{
main{ main{
margin-top: 0px; margin-top: 20px;
max-width: 700px; max-width: 700px;
transform: scale(0.8) translateY(-20px); transform: scale(0.8) translateY(-80px);
h1{ h1{
font-size: calc(100vw / 50); font-size: calc(100vw / 50);
} }
p{ p{
font-size: calc(100vw / 90); font-size: calc(100vw / 95);
} }
} }
} }

@ -33,7 +33,7 @@
@media screen and (min-width: 1008px) and (max-width: 1440px) { @media screen and (min-width: 1008px) and (max-width: 1440px) {
.download-attachments{ .download-attachments{
width: calc(100% - 20px); width: calc(100% - 20px);
padding: 20px 0px; padding: 10px 0px;
a{ a{
font-size: calc(100vw / 100); font-size: calc(100vw / 100);
} }

@ -30,8 +30,8 @@
.video-tube-suggest{ .video-tube-suggest{
width: 30%; width: 30%;
img{ img{
width: 130px; width: 100%;
height: 180px; // height: 180px;
} }
h4{ h4{
font-size: calc(100vw / 90); font-size: calc(100vw / 90);

@ -18,6 +18,9 @@
&--count{ &--count{
color: white; color: white;
} }
&--active{
background: rgba(#ebebeb, 0.21);
}
&--text{ &--text{
padding: 15px 10px; padding: 15px 10px;
h4{ h4{

@ -1,8 +1,9 @@
import React from "react"; import React from "react";
import './index.scss'; import "./index.scss";
import { connect } from "react-redux";
import {book} from '../../../redux/actions';
export default function LessonPlayList(props: any) { function LessonPlayList({ lesson, selectedVideo,setVideoActive }: any) {
const { lesson } = props;
return ( return (
<div className="lesson-playlist d-flex flex-column"> <div className="lesson-playlist d-flex flex-column">
<header className="d-flex align-items-center"> <header className="d-flex align-items-center">
@ -10,7 +11,15 @@ export default function LessonPlayList(props: any) {
<span></span> <span></span>
</header> </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" key={i}> <div
className={
"lesson-playlist__item d-flex align-items-center" + ' ' +
(file.name === selectedVideo.name &&
"lesson-playlist__item--active")
}
key={i}
onClick={() => setVideoActive(file)}
>
<span className="lesson-playlist__item--count">{i + 1}</span> <span className="lesson-playlist__item--count">{i + 1}</span>
<div className="lesson-playlist__item--video"> <div className="lesson-playlist__item--video">
<video> <video>
@ -27,3 +36,9 @@ export default function LessonPlayList(props: any) {
</div> </div>
); );
} }
export default connect((state: any) => ({
selectedVideo: state.book.selectedVideo,
}), {
setVideoActive : book.setVideoActive,
})(LessonPlayList);

@ -219,7 +219,7 @@
max-height: 320px; max-height: 320px;
header { header {
padding: 14px 12px; padding: 14px 12px;
background-color: #2c2c2c; background-color: rgba(#ebebeb, 0.21);
h2 { h2 {
font-size: 18px; font-size: 18px;
} }
@ -229,9 +229,10 @@
} }
} }
&--suggests { &--suggests {
background-color: #001702;
header { header {
padding: 26px 12px; padding: 26px 12px;
background-color: #8bd09746; // background-color: #8bd09746;
h2 { h2 {
font-size: 18px; font-size: 18px;
} }
@ -241,7 +242,7 @@
} }
&___list{ &___list{
padding: 15px 12px; padding: 15px 12px;
background-color: #08793d58; // background-color: #08793d58;
} }
} }
} }
@ -313,10 +314,10 @@
} }
} }
&--attachments { &--attachments {
max-height: 320px; max-height: 250px;
header { header {
padding: 14px 12px; padding: 14px 12px;
background-color: #2c2c2c; background-color: rgba(#ebebeb, 0.21);
h2 { h2 {
font-size: calc(100vw / 85); font-size: calc(100vw / 85);
} }
@ -326,9 +327,10 @@
} }
} }
&--suggests { &--suggests {
background-color: #001702;
header { header {
padding: 26px 12px; padding: 26px 12px;
background-color: #8bd09746; background-color: rgba(#ebebeb, 0.21);
h2 { h2 {
font-size: calc(100vw / 85); font-size: calc(100vw / 85);
} }
@ -338,7 +340,7 @@
} }
&___list{ &___list{
padding: 15px 12px; padding: 15px 12px;
background-color: #08793d58; background-color: #ffffff00;
} }
} }
} }
@ -441,7 +443,7 @@
} }
&___list{ &___list{
padding: 15px 12px; padding: 15px 12px;
background-color: #08793d58; background-color: #ffffff00;
} }
} }
} }

Loading…
Cancel
Save