From 1d4a13924670bb66d291d6f446a47f191ebe072c Mon Sep 17 00:00:00 2001 From: RezaAshrafi77 Date: Sun, 1 Aug 2021 17:07:13 +0430 Subject: [PATCH] reza added some changes --- src/AppRouter.js | 1 + src/Redux/actions/user.js | 8 ++ src/Redux/proxy.js | 5 +- src/Redux/reducers/qr.js | 17 +++- src/Redux/reducers/user.js | 28 +++--- src/views/AR/index.scss | 2 +- src/views/About/index.scss | 71 +++++++------- src/views/Auth/Login/Cellphone/index.scss | 7 +- src/views/Auth/Login/Code/index.js | 49 +++++++--- src/views/Auth/Login/Code/index.scss | 32 ++++--- src/views/Auth/Login/Timer/index.js | 29 +++++- src/views/Auth/Login/index.js | 2 + src/views/Auth/Profile/index.js | 7 +- src/views/Auth/index.scss | 2 + src/views/Cart/Discount/index.js | 36 +++---- src/views/Cart/index.scss | 33 +++---- src/views/Contact/Select/index.js | 49 ++++------ src/views/Contact/index.js | 4 +- src/views/Contact/index.scss | 11 ++- src/views/Faq/index.scss | 2 +- src/views/Home/Membership/Input/index.js | 25 +++-- src/views/Home/Membership/index.scss | 1 + src/views/Home/Navbar/Mobile/index.scss | 26 ++--- src/views/Home/Navbar/index.scss | 8 +- src/views/Home/index.scss | 2 +- src/views/MyBooks/index.scss | 22 ++--- src/views/Product/index.js | 4 +- src/views/Product/index.scss | 2 +- src/views/Products/index.scss | 29 +++--- src/views/QR/index.js | 111 ++++++++++++++-------- src/views/QR/index.scss | 20 ++-- src/views/QRScan/Scanner/index.js | 4 +- src/views/QRScan/index.scss | 3 +- 33 files changed, 377 insertions(+), 275 deletions(-) diff --git a/src/AppRouter.js b/src/AppRouter.js index 4025fa4..3112e34 100644 --- a/src/AppRouter.js +++ b/src/AppRouter.js @@ -102,6 +102,7 @@ class AppRouter extends Component { export default connect( (state) => ({ profile: state.user.status.profile || {}, + // status: state.user.status, }), {} )(AppRouter); diff --git a/src/Redux/actions/user.js b/src/Redux/actions/user.js index db2572b..323b730 100644 --- a/src/Redux/actions/user.js +++ b/src/Redux/actions/user.js @@ -2,8 +2,16 @@ import proxy from "../proxy"; const user = { otp: (data, history) => async (dispatch) => await proxy.login("public/sendOTP", data, { history, dispatch }), + // otp: + // (data = {}) => + // async (dispatch) => + // dispatch({ type: "public/sendOTP", payload: data }), otp_login: (data, history) => async (dispatch) => await proxy.login("user/otp/login", data, { history, dispatch }), + // otp_login: + // (data = {}) => + // async (dispatch) => + // dispatch({ type: "user/otp/login", payload: data }), register: (data, history) => async (dispatch) => await proxy.login("user/register", data, { history, dispatch }), switchRole: (data, history) => async (dispatch) => diff --git a/src/Redux/proxy.js b/src/Redux/proxy.js index 631493e..5f589d6 100644 --- a/src/Redux/proxy.js +++ b/src/Redux/proxy.js @@ -1,15 +1,14 @@ import { ApiConfig } from "./../constants/defaultValues"; import axios from "axios"; -let { baseUrl, apiKey } = ApiConfig; +let { baseUrl } = ApiConfig; let access = window.localStorage.getItem("access"); baseUrl = baseUrl + "/"; -const baseUrl2 = "https://dnvn.ir/api/v1"; const Axios = axios.create({ withCredentials: true, validateStatus: null, baseURL: baseUrl, - headers: access ? { Authorization: `Bearer ${access}` } : {}, + //headers: access ? { Authorization: `Bearer ${access}` } : {}, }); class Proxy { get = async (url, params, opt = {}) => diff --git a/src/Redux/reducers/qr.js b/src/Redux/reducers/qr.js index d7796e3..2023b9a 100644 --- a/src/Redux/reducers/qr.js +++ b/src/Redux/reducers/qr.js @@ -56,7 +56,22 @@ export default function qr(state = initialState, action) { return { ...state, loading: false, - list: action.payload === "Zist10-13" ? [] : null, + list: + action.payload === "Zist10-13" + ? [ + { + type: "pdf", + title: "فایل پی دی اف ارائه درس آتشفشان", + link: "", + }, + ] + : [ + { + type: "h1", + text: "صفحه‌ای یافت نشد", + file: null, + }, + ], error: null, }; ///////////// diff --git a/src/Redux/reducers/user.js b/src/Redux/reducers/user.js index d9ddd9c..64b3491 100644 --- a/src/Redux/reducers/user.js +++ b/src/Redux/reducers/user.js @@ -1,4 +1,4 @@ -import proxy from '../proxy'; +import proxy from "../proxy"; const initialState = { status: proxy.status(), loading: false, @@ -10,27 +10,29 @@ const initialState = { export default function user(state = initialState, action) { let { type, data } = action; switch (type) { - case 'user/login': - case 'user/register': - case 'user/otp/login': - case 'user/switchRole': + case "user/login": + case "user/register": + case "user/switchRole": + case "public/sendOTP": + case "user/otp/login": return { ...state, loading: false, status: data, error: null }; - case 'user/logout': + case "user/logout": return { ...state, loading: false, status: proxy.status(), error: null }; - case 'user/getUserRole': + case "user/getUserRole": return { ...state, loading: false, userRoles: data, error: null }; - case 'user/list': + case "user/list": return { ...state, loading: false, list: data, error: null }; - case 'user/domains': + case "user/domains": return { ...state, loading: false, domains: data, error: null }; - case 'mothers/list': + case "mothers/list": return { ...state, loading: false, mothers: data, error: null }; + ///////////// - case 'loading': + case "loading": return { ...state, loading: true }; - case 'error': + case "error": return { ...state, loading: false, error: data.message }; default: return state; } -} \ No newline at end of file +} diff --git a/src/views/AR/index.scss b/src/views/AR/index.scss index a1a5c0a..0c19cfc 100644 --- a/src/views/AR/index.scss +++ b/src/views/AR/index.scss @@ -4,7 +4,7 @@ margin: 0px auto; padding: 0px 10px 40px; direction: rtl; - padding-top: 90px; + padding-top: 70px; overflow-x: hidden; } diff --git a/src/views/About/index.scss b/src/views/About/index.scss index b895647..ec35fda 100644 --- a/src/views/About/index.scss +++ b/src/views/About/index.scss @@ -19,7 +19,7 @@ display: inline; letter-spacing: -2px; font-family: numeralBold; - background-color: #00CC69; + background-color: #00cc69; color: white; } p { @@ -35,7 +35,7 @@ h2 { display: inline; font-family: numeralBold; - background-color: #00CC69; + background-color: #00cc69; color: white; } ul { @@ -45,7 +45,7 @@ margin-top: 5px; li { display: inline; - border-bottom: 2px solid #00CC69; + border-bottom: 2px solid #00cc69; font-family: numeralLight; color: #6d6d6d; } @@ -56,34 +56,31 @@ width: 60%; height: 100%; position: relative; - & img{ + & img { position: absolute; } - &__1{ - top:0px; + &__1 { + top: 0px; left: 100px; z-index: 100; height: 470px; - width: 470px - + width: 470px; } - &__2{ + &__2 { left: 430px; bottom: 80px; z-index: 150; height: 235px; width: 235px; - } - &__3{ + &__3 { bottom: 0px; left: 310px; z-index: 200; height: 200px; width: 200px; - } - &__4{ + &__4 { top: 50px; left: 0px; z-index: 150; @@ -101,7 +98,7 @@ &--right { width: 48%; height: 100%; - & img{ + & img { width: 100%; } } @@ -114,7 +111,7 @@ h1 { display: inline; font-family: numeralBold; - background-color: #00CC69; + background-color: #00cc69; color: white; } ul { @@ -133,20 +130,20 @@ } } -.mobile-about{ +.mobile-about { width: 100vw; max-width: 650px; margin: 0px auto; - padding : 0px 10px 40px; + padding: 0px 10px 40px; direction: rtl; - padding-top: 90px; + padding-top: 70px; overflow-x: hidden; - &__fury{ + &__fury { h1 { display: inline; letter-spacing: -2px; font-family: numeralBold; - background-color: #00CC69; + background-color: #00cc69; color: white; } p { @@ -157,25 +154,23 @@ letter-spacing: -1px; } } - &__images{ + &__images { position: relative; height: 330px; width: 100%; - & img{ + & img { position: absolute; - } - &--1{ - top:0px; + &--1 { + top: 0px; left: calc(100vw / 8); z-index: 100; height: calc(100vw - 100px); width: calc(100vw - 100px); max-width: 275px; max-height: 275px; - } - &--2{ + &--2 { right: -20px; bottom: 70px; z-index: 150; @@ -183,9 +178,8 @@ width: calc(100vw / 2.5); max-width: 150px; max-height: 150px; - } - &--3{ + &--3 { bottom: -10px; right: -10px; z-index: 200; @@ -193,9 +187,8 @@ width: calc(100vw / 3); max-width: 125px; max-height: 125px; - } - &--4{ + &--4 { top: 50px; left: -20px; z-index: 150; @@ -205,12 +198,12 @@ max-height: 125px; } } - &__keys{ - transform : translateY(-40px); + &__keys { + transform: translateY(-40px); h2 { display: inline; font-family: numeralBold; - background-color: #00CC69; + background-color: #00cc69; color: white; } ul { @@ -220,23 +213,23 @@ margin-top: 5px; li { display: inline; - border-bottom: 2px solid #00CC69; + border-bottom: 2px solid #00cc69; font-family: numeralLight; color: #6d6d6d; } } } - &__video{ + &__video { img { width: 100%; } } - &__advantages{ + &__advantages { margin-top: 30px; h1 { display: inline; font-family: numeralBold; - background-color: #00CC69; + background-color: #00cc69; color: white; // margin-bottom: 20px; } @@ -254,4 +247,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/views/Auth/Login/Cellphone/index.scss b/src/views/Auth/Login/Cellphone/index.scss index 5eee6d2..97d161d 100644 --- a/src/views/Auth/Login/Cellphone/index.scss +++ b/src/views/Auth/Login/Cellphone/index.scss @@ -89,6 +89,7 @@ max-width: 500px; margin: 0px auto; padding: 10px; + position: relative; img { margin-bottom: 30px; position: relative; @@ -120,7 +121,7 @@ text-align: right; position: absolute; left: 65px; - top: 7px; + top: 8px; direction: ltr; font-family: numeralLight; color: #a5a5a5; @@ -135,7 +136,7 @@ text-align: left; background-color: #f2f2f2; border: none; - padding: 0px 5px 0px 83px; + padding: 0px 5px 0px 81px; border-radius: 5px; &:focus { outline: 0px; @@ -153,7 +154,7 @@ } } &__footer { - position: fixed; + position: absolute; bottom: 40px; div { font-family: numeralLight; diff --git a/src/views/Auth/Login/Code/index.js b/src/views/Auth/Login/Code/index.js index ebe87ea..4dbdb7b 100644 --- a/src/views/Auth/Login/Code/index.js +++ b/src/views/Auth/Login/Code/index.js @@ -1,4 +1,5 @@ import React, { Component } from "react"; +import { Link } from "react-router-dom"; import Timer from "../Timer/index"; import logo from "../../../../assets/icons/logo.png"; @@ -7,6 +8,7 @@ import pic from "../../../../assets/images/pic.png"; import "./index.scss"; const maxDesktopSize = 1250; +const maxMobileSize = 550; const fontSize = { desktop: { @@ -14,6 +16,13 @@ const fontSize = { button: window.innerWidth > maxDesktopSize ? 16 : window.innerWidth / 85, div: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 95, }, + mobile: { + h1: window.innerWidth > maxMobileSize ? 24 : window.innerWidth / 13, + p: window.innerWidth > maxMobileSize ? 13 : window.innerWidth / 27, + input: window.innerWidth > maxMobileSize ? 20 : window.innerWidth / 85, + button: window.innerWidth > maxMobileSize ? 16 : window.innerWidth / 85, + div: window.innerWidth > maxMobileSize ? 12 : window.innerWidth / 30, + }, }; export default class Code extends Component { constructor(props) { @@ -87,10 +96,10 @@ export default class Code extends Component {
دانوین -
+
) : null} {window.innerWidth < 1000 ? ( -
+
دانوین -
-

دانوین

-

+

+

دانوین

+

یک کد تائیدیه به شماره{" "} {this.props.parent.state.cellphone} ارسال شد
آن را در قسمت زیر وارد کنید.

-
+