From 1a994a6a1069da39aee6a5c1261cb95495557991 Mon Sep 17 00:00:00 2001 From: RezaAshrafi77 Date: Fri, 8 Oct 2021 01:02:24 +0330 Subject: [PATCH] reza added some change --- src/components/PrivateRouter/index.js | 2 +- src/redux/reducers/public.tsx | 2 ++ src/router.js | 23 ++++++++++++++++++----- src/views/Auth/Login/index.scss | 13 +++++++------ src/views/Home/Blogs/Blog/index.scss | 4 ++-- src/views/Home/Blogs/index.scss | 3 --- src/views/Home/Blogs/index.tsx | 2 +- src/views/Home/Books/index.tsx | 4 ++-- src/views/Home/Courses/index.tsx | 9 +++++++-- 9 files changed, 40 insertions(+), 22 deletions(-) diff --git a/src/components/PrivateRouter/index.js b/src/components/PrivateRouter/index.js index bf3530b..e9b84d1 100644 --- a/src/components/PrivateRouter/index.js +++ b/src/components/PrivateRouter/index.js @@ -12,7 +12,7 @@ const PrivateRouter = ({ - 1 ? ( + status ? ( ) : ( diff --git a/src/redux/reducers/public.tsx b/src/redux/reducers/public.tsx index a6057bf..a1c9806 100644 --- a/src/redux/reducers/public.tsx +++ b/src/redux/reducers/public.tsx @@ -1,5 +1,7 @@ import { PublicAction } from "../actions-type"; +import proxy from '../proxy'; const initialState = { + status : proxy.status(), homeData: [], newProducts: [], levels: [], diff --git a/src/router.js b/src/router.js index 941e77a..536f281 100644 --- a/src/router.js +++ b/src/router.js @@ -3,6 +3,7 @@ import { BrowserRouter as Router, Route, Switch, + Redirect, } from "react-router-dom"; import { connect } from "react-redux"; @@ -14,18 +15,20 @@ import Subscription from "./views/Subscription/index"; import Contact from "./views/Contact/index"; import Faq from "./views/Faq/index"; import PrivateRouter from "./components/PrivateRouter/index"; +import proxy from "./redux/proxy"; function router({ status }) { + const home = ( + {proxy.status() ? : } + ); return ( + {home} - - - @@ -35,8 +38,18 @@ function router({ status }) { path="/courses/:id" exact /> - - + + diff --git a/src/views/Auth/Login/index.scss b/src/views/Auth/Login/index.scss index 7e1e8be..ec1eceb 100644 --- a/src/views/Auth/Login/index.scss +++ b/src/views/Auth/Login/index.scss @@ -35,11 +35,6 @@ bottom: 0px; left: 0px; } - &__back{ - img{ - transform: rotate(-90deg); - } - } } @media screen and (min-width: 1441px) { @@ -78,6 +73,9 @@ } &__back { margin-bottom: 60px; + img{ + transform: rotate(-90deg); + } a { color: white; font-size: 13px; @@ -197,6 +195,9 @@ } &__back { margin-bottom: 40px; + img{ + transform: rotate(-90deg); + } a { color: white; font-size: calc(100vw / 110); @@ -511,6 +512,7 @@ font-family: numeralLight; font-size: calc(100vw / 20); background-color: #2A2A2A; + border-radius: 10px; &:focus{ border: 0.2px solid #84de56 !important; border-radius: 10px; @@ -546,7 +548,6 @@ letter-spacing: -1px; font-size: calc(100vw / 30); z-index: 110; - border-radius: 50%; } .Mui-focused { color: rgba(0, 0, 0, 1) !important; diff --git a/src/views/Home/Blogs/Blog/index.scss b/src/views/Home/Blogs/Blog/index.scss index 4619eab..86c190c 100644 --- a/src/views/Home/Blogs/Blog/index.scss +++ b/src/views/Home/Blogs/Blog/index.scss @@ -76,8 +76,8 @@ @media screen and (max-width: 640px) { .home-blogs-blog { - width: 100vw; - height: calc(100vw / 2.2); + width: 100%; + height: 150px; margin: 10px 0px 0px; h2 { font-family: numeralLight; diff --git a/src/views/Home/Blogs/index.scss b/src/views/Home/Blogs/index.scss index bc29267..1b4c8bc 100644 --- a/src/views/Home/Blogs/index.scss +++ b/src/views/Home/Blogs/index.scss @@ -108,9 +108,6 @@ display: flex !important; justify-content: flex-end !important; align-items: center !important; - & img{ - height: 200px !important; - } margin: 0px 0px 100px 0px !important; width : 100% !important; } diff --git a/src/views/Home/Blogs/index.tsx b/src/views/Home/Blogs/index.tsx index aa3bb0c..5c9e794 100644 --- a/src/views/Home/Blogs/index.tsx +++ b/src/views/Home/Blogs/index.tsx @@ -37,7 +37,7 @@ function Blogs(props: any) { showArrows={false} pagination={false} > - {list?.map((item: Object, i: Number) => ( + {list.map((item: Object, i: Number) => ( ))} diff --git a/src/views/Home/Books/index.tsx b/src/views/Home/Books/index.tsx index d9bf65a..aff73c2 100644 --- a/src/views/Home/Books/index.tsx +++ b/src/views/Home/Books/index.tsx @@ -31,13 +31,13 @@ function Books({list, number}: any) { showArrows={true} pagination={false} > - {list.map((item: Object, i: Number) => ( + {list?.map((item: Object, i: Number) => ( ))} ) : (
- {list.map((item: Object, i: Number) => ( + {list?.map((item: Object, i: Number) => ( ))}
diff --git a/src/views/Home/Courses/index.tsx b/src/views/Home/Courses/index.tsx index 0c689d0..9dc7505 100644 --- a/src/views/Home/Courses/index.tsx +++ b/src/views/Home/Courses/index.tsx @@ -3,9 +3,10 @@ import Carousel from "react-elastic-carousel"; import Course from "./Course/index"; import { Link } from "react-router-dom"; import ExpandMoreRoundedIcon from "@mui/icons-material/ExpandMoreRounded"; +import {connect} from 'react-redux'; import "./index.scss"; -export default function Courses({number, courses} : any) { +function Courses({number, courses, selectedSort} : any) { const slideNumberHandler = () => { if (window.innerWidth >= 1440) { return 4; @@ -21,7 +22,7 @@ export default function Courses({number, courses} : any) {
-

جدیدترین دوره‌ها

+

{selectedSort}

در این قسمت شاید یک متن جهت زیباسازی قرار بگیرد.
@@ -58,3 +59,7 @@ export default function Courses({number, courses} : any) {
); } + +export default connect((state : any) => ({ + selectedSort : state.book.selectedSort, +}))(Courses) \ No newline at end of file