reza added some change

master
RezaAshrafi77 3 years ago
parent be2401b918
commit 1a994a6a10
  1. 2
      src/components/PrivateRouter/index.js
  2. 2
      src/redux/reducers/public.tsx
  3. 23
      src/router.js
  4. 13
      src/views/Auth/Login/index.scss
  5. 4
      src/views/Home/Blogs/Blog/index.scss
  6. 3
      src/views/Home/Blogs/index.scss
  7. 2
      src/views/Home/Blogs/index.tsx
  8. 4
      src/views/Home/Books/index.tsx
  9. 9
      src/views/Home/Courses/index.tsx

@ -12,7 +12,7 @@ const PrivateRouter = ({
<Route <Route
{...rest} {...rest}
render={(props) => render={(props) =>
1 ? ( status ? (
<Component {...props} /> <Component {...props} />
) : ( ) : (
<Redirect to="/login" /> <Redirect to="/login" />

@ -1,5 +1,7 @@
import { PublicAction } from "../actions-type"; import { PublicAction } from "../actions-type";
import proxy from '../proxy';
const initialState = { const initialState = {
status : proxy.status(),
homeData: [], homeData: [],
newProducts: [], newProducts: [],
levels: [], levels: [],

@ -3,6 +3,7 @@ import {
BrowserRouter as Router, BrowserRouter as Router,
Route, Route,
Switch, Switch,
Redirect,
} from "react-router-dom"; } from "react-router-dom";
import { connect } from "react-redux"; import { connect } from "react-redux";
@ -14,18 +15,20 @@ import Subscription from "./views/Subscription/index";
import Contact from "./views/Contact/index"; import Contact from "./views/Contact/index";
import Faq from "./views/Faq/index"; import Faq from "./views/Faq/index";
import PrivateRouter from "./components/PrivateRouter/index"; import PrivateRouter from "./components/PrivateRouter/index";
import proxy from "./redux/proxy";
function router({ status }) { function router({ status }) {
const home = (
<Route path="/">{proxy.status() ? <Home /> : <Auth page="signup" />}</Route>
);
return ( return (
<Router> <Router>
<Switch> <Switch>
{home}
<PrivateRouter restricted={false} component={Home} path="/" exact /> <PrivateRouter restricted={false} component={Home} path="/" exact />
<Route exact path={"/sign-up"}> <Route exact path={"/sign-up"}>
<Auth page="signup" /> <Auth page="signup" />
</Route> </Route>
<Route exact path={"/login"}>
<Auth page="login" />
</Route>
<Route exact path={"/profile"}> <Route exact path={"/profile"}>
<Auth page="profile" /> <Auth page="profile" />
</Route> </Route>
@ -35,8 +38,18 @@ function router({ status }) {
path="/courses/:id" path="/courses/:id"
exact exact
/> />
<PrivateRouter restricted={false} component={VideoTube} path="/video-tube" exact /> <PrivateRouter
<PrivateRouter restricted={false} component={Subscription} path="/subscribe" exact /> restricted={false}
component={VideoTube}
path="/video-tube"
exact
/>
<PrivateRouter
restricted={false}
component={Subscription}
path="/subscribe"
exact
/>
<Route exact path={"/contact"}> <Route exact path={"/contact"}>
<Contact /> <Contact />
</Route> </Route>

@ -35,11 +35,6 @@
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) {
@ -78,6 +73,9 @@
} }
&__back { &__back {
margin-bottom: 60px; margin-bottom: 60px;
img{
transform: rotate(-90deg);
}
a { a {
color: white; color: white;
font-size: 13px; font-size: 13px;
@ -197,6 +195,9 @@
} }
&__back { &__back {
margin-bottom: 40px; margin-bottom: 40px;
img{
transform: rotate(-90deg);
}
a { a {
color: white; color: white;
font-size: calc(100vw / 110); font-size: calc(100vw / 110);
@ -511,6 +512,7 @@
font-family: numeralLight; font-family: numeralLight;
font-size: calc(100vw / 20); font-size: calc(100vw / 20);
background-color: #2A2A2A; background-color: #2A2A2A;
border-radius: 10px;
&:focus{ &:focus{
border: 0.2px solid #84de56 !important; border: 0.2px solid #84de56 !important;
border-radius: 10px; border-radius: 10px;
@ -546,7 +548,6 @@
letter-spacing: -1px; letter-spacing: -1px;
font-size: calc(100vw / 30); font-size: calc(100vw / 30);
z-index: 110; z-index: 110;
border-radius: 50%;
} }
.Mui-focused { .Mui-focused {
color: rgba(0, 0, 0, 1) !important; color: rgba(0, 0, 0, 1) !important;

@ -76,8 +76,8 @@
@media screen and (max-width: 640px) { @media screen and (max-width: 640px) {
.home-blogs-blog { .home-blogs-blog {
width: 100vw; width: 100%;
height: calc(100vw / 2.2); height: 150px;
margin: 10px 0px 0px; margin: 10px 0px 0px;
h2 { h2 {
font-family: numeralLight; font-family: numeralLight;

@ -108,9 +108,6 @@
display: flex !important; display: flex !important;
justify-content: flex-end !important; justify-content: flex-end !important;
align-items: center !important; align-items: center !important;
& img{
height: 200px !important;
}
margin: 0px 0px 100px 0px !important; margin: 0px 0px 100px 0px !important;
width : 100% !important; width : 100% !important;
} }

@ -37,7 +37,7 @@ function Blogs(props: any) {
showArrows={false} showArrows={false}
pagination={false} pagination={false}
> >
{list?.map((item: Object, i: Number) => ( {list.map((item: Object, i: Number) => (
<Blog data={item} key={i} /> <Blog data={item} key={i} />
))} ))}
</Carousell> </Carousell>

@ -31,13 +31,13 @@ function Books({list, number}: any) {
showArrows={true} showArrows={true}
pagination={false} pagination={false}
> >
{list.map((item: Object, i: Number) => ( {list?.map((item: Object, i: Number) => (
<Book data={item} key={i} /> <Book data={item} key={i} />
))} ))}
</Carousel> </Carousel>
) : ( ) : (
<div className="home-books__list d-flex"> <div className="home-books__list d-flex">
{list.map((item: Object, i: Number) => ( {list?.map((item: Object, i: Number) => (
<Book data={item} key={i} /> <Book data={item} key={i} />
))} ))}
</div> </div>

@ -3,9 +3,10 @@ import Carousel from "react-elastic-carousel";
import Course from "./Course/index"; import Course from "./Course/index";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import ExpandMoreRoundedIcon from "@mui/icons-material/ExpandMoreRounded"; import ExpandMoreRoundedIcon from "@mui/icons-material/ExpandMoreRounded";
import {connect} from 'react-redux';
import "./index.scss"; import "./index.scss";
export default function Courses({number, courses} : any) { function Courses({number, courses, selectedSort} : any) {
const slideNumberHandler = () => { const slideNumberHandler = () => {
if (window.innerWidth >= 1440) { if (window.innerWidth >= 1440) {
return 4; return 4;
@ -21,7 +22,7 @@ export default function Courses({number, courses} : any) {
<section className="home-courses d-flex flex-column"> <section className="home-courses d-flex flex-column">
<header className="d-flex justify-content-between"> <header className="d-flex justify-content-between">
<div className="d-flex flex-column"> <div className="d-flex flex-column">
<h1>جدیدترین دورهها</h1> <h1>{selectedSort}</h1>
<span>در این قسمت شاید یک متن جهت زیباسازی قرار بگیرد.</span> <span>در این قسمت شاید یک متن جهت زیباسازی قرار بگیرد.</span>
</div> </div>
<Link to="/"> <Link to="/">
@ -58,3 +59,7 @@ export default function Courses({number, courses} : any) {
</section> </section>
); );
} }
export default connect((state : any) => ({
selectedSort : state.book.selectedSort,
}))(Courses)
Loading…
Cancel
Save