diff --git a/src/App.css b/src/App.css index 19197c3..4bee1f4 100644 --- a/src/App.css +++ b/src/App.css @@ -3,6 +3,8 @@ } + + .App-logo { height: 40vmin; pointer-events: none; diff --git a/src/assets/icons/logo.png b/src/assets/icons/logo.png new file mode 100644 index 0000000..42ea219 Binary files /dev/null and b/src/assets/icons/logo.png differ diff --git a/src/components/GradeFilter/index.scss b/src/components/GradeFilter/index.scss index a5a7815..e9ffdc5 100644 --- a/src/components/GradeFilter/index.scss +++ b/src/components/GradeFilter/index.scss @@ -56,7 +56,7 @@ font-size: calc(100vw / 120); } li{ - font-size: calc(100vw / 90); + font-size: calc(100vw / 110); background-color: rgba(255, 255, 255, 0) ; z-index: 100; padding: 10px 0px !important; diff --git a/src/components/HomeSearchBox/index.scss b/src/components/HomeSearchBox/index.scss index 0dc3ef0..019bcce 100644 --- a/src/components/HomeSearchBox/index.scss +++ b/src/components/HomeSearchBox/index.scss @@ -37,18 +37,22 @@ &__voice { display: none; } + form { width: 1000px; input { - font-size: 20px; + font-size: 16px; padding-right: 20px; &::placeholder { - font-size: 20px; + font-size: 16px; } } button { - width: 80px; + width: 70px; height: 60px; + img{ + width: 35px; + } } } ul { diff --git a/src/components/Menu/index.js b/src/components/Menu/index.js new file mode 100644 index 0000000..96d4bf7 --- /dev/null +++ b/src/components/Menu/index.js @@ -0,0 +1,67 @@ +import * as React from 'react'; +import { styled, alpha } from '@mui/material/styles'; +import Button from '@mui/material/Button'; +import Menu from '@mui/material/Menu'; +import MenuItem from '@mui/material/MenuItem'; +import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown'; + +const StyledMenu = styled((props) => ( + +))(({ theme }) => ({ +})); + +export default function CustomizedMenus({items}) { + const [anchorEl, setAnchorEl] = React.useState(null); + const open = Boolean(anchorEl); + const handleClick = (event) => { + setAnchorEl(event.currentTarget); + }; + const handleClose = () => { + setAnchorEl(null); + }; + + return ( +
+ + + { + items.map((item, i) => ( + + {item.name} + + )) + } + +
+ ); +} \ No newline at end of file diff --git a/src/components/Navbar/index.scss b/src/components/Navbar/index.scss index a2f0857..e98e0a3 100644 --- a/src/components/Navbar/index.scss +++ b/src/components/Navbar/index.scss @@ -33,6 +33,11 @@ &___login{ background-color: #81C342; } + &___logo{ + img{ + height: 50px; + } + } } @media screen and (min-width: 1441px){ @@ -42,14 +47,7 @@ &--links{ li{ padding: 0px 20px; - font-size: 18px; - span{ - width: 2px; - height: 15px; - background-color: rgb(197, 197, 197); - margin-right: 15px; - // transform: translateY(-1px); - } + font-size: 14px; } } &--buttons{ @@ -62,11 +60,17 @@ } } &___logo{ - padding-right: 0px !important; + // padding-right: 0px !important; + span{ + width: 2px; + height: 15px; + background-color: rgb(197, 197, 197); + margin-right: 15px; + transform: translateY(-1px); + } } - &___share{ - margin-left: 20px; - font-size: 14px; + &___login{ + margin-right: 20px; } } diff --git a/src/components/Navbar/index.tsx b/src/components/Navbar/index.tsx index 1d82a69..9b0fed9 100644 --- a/src/components/Navbar/index.tsx +++ b/src/components/Navbar/index.tsx @@ -7,6 +7,8 @@ import NavbarDrawer from "../NavbarDrawer/NavbarDrawer"; import clsx from "clsx"; import proxy from "../../redux/proxy"; import { makeStyles } from "@mui/styles"; +import Menu from '../Menu/index'; +import logoIcon from '../../assets/icons/logo.png'; const useStyles = makeStyles({ list: { @@ -66,14 +68,11 @@ export default function Navbar(props: any) {
خرید اشتراک {!userStatus && ( -
  • +
  • ورود
  • )} @@ -103,3 +102,56 @@ export default function Navbar(props: any) { ); } + +Navbar.defaultProps = { + grades: [ + { + name: "اول", + value: 1, + }, + { + name: "دوم", + value: 2, + }, + { + name: "سوم", + value: 3, + }, + { + name: "چهارم", + value: 4, + }, + { + name: "پنجم", + value: 5, + }, + { + name: "ششم", + value: 6, + }, + { + name: "هفتم", + value: 7, + }, + { + name: "هشتم", + value: 8, + }, + { + name: "نهم", + value: 9, + }, + { + name: "دهم", + value: 10, + }, + { + name: "یازدهم", + value: 11, + }, + { + name: "دوازدهم", + value: 12, + }, + ], +} \ No newline at end of file diff --git a/src/components/PrivateRouter/index.js b/src/components/PrivateRouter/index.js index a602432..ea9b2cd 100644 --- a/src/components/PrivateRouter/index.js +++ b/src/components/PrivateRouter/index.js @@ -1,5 +1,5 @@ -import React, { Component } from "react"; -import { Route, useHistory, Redirect } from "react-router-dom"; +import React from "react"; +import { Route, Redirect } from "react-router-dom"; import { connect } from "react-redux"; const PrivateRouter = ({ @@ -12,7 +12,7 @@ const PrivateRouter = ({ - status ? ( + true ? ( ) : ( diff --git a/src/custom.scss b/src/custom.scss index a67060a..a91917d 100644 --- a/src/custom.scss +++ b/src/custom.scss @@ -228,9 +228,38 @@ p{ transform : translateY(-2px) !important; } + +//Menu +.MuiButton-root{ + font-family: numeralLight !important; + color: white !important; + span{ + margin-left: 0px !important; + margin-right: 5px; + } +} + +.MuiPaper-root{ + .MuiList-root{ + display: flex !important; + width: 200px !important; + flex-wrap: wrap !important; + li{ + width: 100px; + display: flex !important; + justify-content: center !important; + text-align: center !important; + padding: 10px 0px !important; + &:nth-child(even){ + border-right: 1px solid #555 !important; + } + } + } +} + @media screen and (min-width: 1441px) { .submit { - font-size: 20px; + font-size: 16px; } .main { main { diff --git a/src/index.css b/src/index.css index ea88952..0f39431 100644 --- a/src/index.css +++ b/src/index.css @@ -8,6 +8,11 @@ body { -moz-osx-font-smoothing: grayscale; } +body::-webkit-scrollbar{ + scrollbar-width: 0px !important; + display: none; +} + code { font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace; diff --git a/src/redux/actions-type/faq.tsx b/src/redux/actions-type/faq.tsx index 9c051eb..b9d1d5a 100644 --- a/src/redux/actions-type/faq.tsx +++ b/src/redux/actions-type/faq.tsx @@ -1,28 +1,33 @@ interface list { - type : "faq/list" - data : any + type: "faq/list"; + data: any; } interface add { - type : "faq/add" - data : any + type: "faq/add"; + data: any; } -interface selectFaq{ - type : "faq/selectFaq" - data : any +interface selectFaq { + type: "faq/selectFaq"; + data: any; } -interface error{ - type : "faq/error" - data : undefined +interface searchFaq { + type: "faq/search"; + data: any; } -interface loading{ - type : "faq/loading" - data : undefined +interface error { + type: "faq/error"; + data: undefined; } -type FaqAction = list | add | selectFaq | loading | error; +interface loading { + type: "faq/loading"; + data: undefined; +} + +type FaqAction = list | searchFaq | add | selectFaq | loading | error; export default FaqAction; diff --git a/src/redux/actions-type/user.tsx b/src/redux/actions-type/user.tsx index 93851ae..d284d97 100644 --- a/src/redux/actions-type/user.tsx +++ b/src/redux/actions-type/user.tsx @@ -1,11 +1,16 @@ interface otp { - type : "public/sendOTP" - data : any + type: "public/sendOTP"; + data: any; } -interface otp_login{ - type : "user/otp/login" - data : any +interface otp_login { + type: "user/otp/login"; + data: any; +} + +interface login { + type: "user/login"; + data: any; } // interface switchRole{ @@ -13,37 +18,45 @@ interface otp_login{ // data : Object // } -interface logout{ - type : "user/logout" - data : any +interface logout { + type: "user/logout"; + data: any; } -interface getUserRole{ - type : "user/getUserRole" - data : any +interface getUserRole { + type: "user/getUserRole"; + data: any; } -interface getProfile{ - type : "user/getProfile" - data : any +interface getProfile { + type: "user/getProfile"; + data: any; } -interface setProfile{ - type : "user/setProfile" - data : any +interface setProfile { + type: "user/setProfile"; + data: any; } -interface error{ - type : "error" - data : undefined +interface error { + type: "error"; + data: undefined; } -interface loading{ - type : "loading" - data : undefined +interface loading { + type: "loading"; + data: undefined; } - -type UserAction = otp | otp_login | logout | getUserRole | getProfile | setProfile | error | loading; +type UserAction = + | otp + | otp_login + | login + | logout + | getUserRole + | getProfile + | setProfile + | error + | loading; export default UserAction; diff --git a/src/redux/actions/faq.tsx b/src/redux/actions/faq.tsx index 0c059af..5147e92 100644 --- a/src/redux/actions/faq.tsx +++ b/src/redux/actions/faq.tsx @@ -13,6 +13,8 @@ const faq = { (data = {}) => async (dispatch: Dispatch) => await dispatch({ type: "faq/selectFaq", data: data }), + searchFaq: (data: String) => async (dispatch: Dispatch) => + await dispatch({ type: "faq/search", data: data }), }; export default faq; diff --git a/src/redux/actions/public.tsx b/src/redux/actions/public.tsx index 041ebb9..46a50cd 100644 --- a/src/redux/actions/public.tsx +++ b/src/redux/actions/public.tsx @@ -4,36 +4,29 @@ const publicApi = { getHomeData: (data: undefined) => async (dispatch: Dispatch) => await proxy.get("public/homePage", data, { dispatch }), - // getFaqList: (data: undefined) => async (dispatch: Dispatch) => - // await proxy.get("faq/list", data, { dispatch }), - setFaqActive: (data: {}) => async (dispatch: Dispatch) => await dispatch({ type: "public/faq/activate", data: data }), - // searchFaq: (data: String) => async (dispatch: Dispatch) => - // await dispatch({ type: "public/faq/search", data: data }), - getContactData: (data = {}) => async (dispatch: Dispatch) => await proxy.get("public/contact", data, { dispatch }), - // getArList: (data: undefined) => async (dispatch: Dispatch) => - // await proxy.get("public/ar", data, { dispatch }), - getBlogList: (data: undefined) => async (dispatch: Dispatch) => await proxy.get("public/blogList", data, { dispatch }), getBlogInfo: (data: String) => async (dispatch: Dispatch) => await proxy.get("public/blogInfo", data, { dispatch }), - setSubscribe : (data: Object) => async (dispatch: Dispatch) => - await dispatch({type : "public/setSubscribe", data : data}), - getProvince: (data = {}) => async (dispatch : Dispatch) => - await proxy.get("public/province", data, { dispatch }), - getCity: (data = {}) => async (dispatch : Dispatch) => - await proxy.get("public/city", data, { dispatch }), - // filterNewProducts: (data: Object) => async (dispatch: Dispatch) => - // await dispatch({ type: "public/filter", data: data }), + setSubscribe: (data: Object) => async (dispatch: Dispatch) => + await dispatch({ type: "public/setSubscribe", data: data }), + getProvince: + (data = {}) => + async (dispatch: Dispatch) => + await proxy.get("public/province", data, { dispatch }), + getCity: + (data = {}) => + async (dispatch: Dispatch) => + await proxy.get("public/city", data, { dispatch }), }; export default publicApi; diff --git a/src/redux/actions/user.tsx b/src/redux/actions/user.tsx index 2ced11f..45582ff 100644 --- a/src/redux/actions/user.tsx +++ b/src/redux/actions/user.tsx @@ -1,12 +1,15 @@ import proxy from "../proxy"; -import {Dispatch} from 'redux'; +import { Dispatch } from "redux"; const user = { - otp: (data : String) => async (dispatch : Dispatch) => - await proxy.post("public/sendOTP", data, { dispatch }), + otp: (data: String) => async (dispatch: Dispatch) => + await proxy.post("public/sendOTP", data, { dispatch }), - otp_login: (data : Object) => async (dispatch : Dispatch) => - await proxy.login("user/otp/login", data, { dispatch }), + otp_login: (data: Object) => async (dispatch: Dispatch) => + await proxy.login("user/otp/login", data, { dispatch }), + + login: (data: Object) => async (dispatch: Dispatch) => + await proxy.login("user/login", data, { dispatch }), // register: (data : undefined) => async (dispatch : Dispatch) => // await proxy.login("user/register", data, { dispatch }), @@ -14,10 +17,10 @@ const user = { // switchRole: (data : String) => async (dispatch : Dispatch) => // await proxy.login("user/switchRole", data, { dispatch }), - logout: (data : String) => async (dispatch : Dispatch) => - await proxy.logout("user/logout", data, { dispatch }), + logout: (data: String) => async (dispatch: Dispatch) => + await proxy.logout("user/logout", data, { dispatch }), - getUserRole: (data : String) => async (dispatch : Dispatch) => + getUserRole: (data: String) => async (dispatch: Dispatch) => await proxy.get("user/getUserRole", data, { dispatch }), // list: @@ -36,23 +39,23 @@ const user = { // }), getProfile: (data = {}) => - async (dispatch : Dispatch) => + async (dispatch: Dispatch) => await proxy.get("user/getProfile", data, { dispatch }), setProfile: (data = {}, data2 = {}) => - async (dispatch : Dispatch) => { + async (dispatch: Dispatch) => { await proxy.put("user/setProfile", data, { dispatch }); await proxy.get("user/getProfile", data2, { dispatch }); }, add: (data = {}, data2 = {}) => - async (dispatch : Dispatch) => { + async (dispatch: Dispatch) => { await proxy.post("user/add", data); await proxy.get("user/list", data2, { dispatch }); }, del: (data = {}, data2 = {}) => - async (dispatch : Dispatch) => { + async (dispatch: Dispatch) => { await proxy.delete("user/delete", data); await proxy.get("user/list", data2, { dispatch }); }, diff --git a/src/redux/reducers/faq.tsx b/src/redux/reducers/faq.tsx index 5cdf5fb..8bfc879 100644 --- a/src/redux/reducers/faq.tsx +++ b/src/redux/reducers/faq.tsx @@ -5,6 +5,8 @@ const initialState = { loading: false, error: null, list: [], + searchResult: [], + search: null, }; export default function faq(state = initialState, action: FaqAction) { let { type, data } = action; @@ -18,10 +20,31 @@ export default function faq(state = initialState, action: FaqAction) { ...state, loading: false, error: null, - list: state.list.map((item: any) => - item.id === data - ? { ...item, active: !item.active } - : { ...item, active: false } + list: !state.search + ? state.list.map((item: any) => + item.id === data + ? { ...item, active: !item.active } + : { ...item, active: false } + ) + : state.list, + searchResult: state.search + ? state.searchResult.map((item: any) => + item.id === data + ? { ...item, active: !item.active } + : { ...item, active: false } + ) + : state.searchResult, + }; + case "faq/search": + return { + ...state, + loading: false, + error: null, + search: data, + searchResult: state.list.filter( + (item: any) => + item.title.indexOf(data) !== -1 || + item.description.indexOf(data) !== -1 ), }; case "faq/loading": diff --git a/src/redux/reducers/user.tsx b/src/redux/reducers/user.tsx index c2b569c..9137070 100644 --- a/src/redux/reducers/user.tsx +++ b/src/redux/reducers/user.tsx @@ -18,10 +18,9 @@ export default function user(state = initialState, action : UserAction) { // case "user/register": // case "user/switchRole": case "public/sendOTP": - toast.success("کد به شماره شما ارسال گردید."); return { ...state, loading: false, status: data.profile, error: null }; + case "user/login": case "user/otp/login": - toast.success("به دانوین خوش آمدید."); return { ...state, loading: false, @@ -35,19 +34,12 @@ export default function user(state = initialState, action : UserAction) { return { ...state, loading: false, status: proxy.status(), error: null }; case "user/getUserRole": return { ...state, loading: false, userRoles: data, error: null }; - // case "user/list": - // return { ...state, loading: false, list: data, error: null }; - // case "user/domains": - // return { ...state, loading: false, domains: data, error: null }; - // case "mothers/list": - // return { ...state, loading: false, mothers: data, error: null }; case "user/setProfile": toast.success("تغییرات اعمال شد."); return { ...state, loading: false, error: null, setDone : true }; case "loading": return { ...state, loading: true }; case "error": - // toast.error(data.message); return { ...state, loading: false, error: data.message }; default: return state; diff --git a/src/router.js b/src/router.js index e9b7d76..c67647c 100644 --- a/src/router.js +++ b/src/router.js @@ -19,7 +19,7 @@ import proxy from "./redux/proxy"; function router({ status }) { const home = ( - {status ? : } + {1 ? : } ); return ( @@ -32,6 +32,9 @@ function router({ status }) { + + + ( undefined ); @@ -41,7 +41,7 @@ function Login(props: any) {
    بازگشت به صفحه قبل - +
    @@ -85,7 +85,7 @@ function Login(props: any) {
    رمز عبور خود را فراموش کرده‌اید؟ -

    props.setPage("signup")}> @@ -97,4 +97,4 @@ function Login(props: any) { ); } -export default connect(() => ({}), { login: user.otp_login })(Login); +export default connect(() => ({}), { login: user.login })(Login); diff --git a/src/views/Auth/SignUp/index.scss b/src/views/Auth/SignUp/index.scss index ab6e212..55f329d 100644 --- a/src/views/Auth/SignUp/index.scss +++ b/src/views/Auth/SignUp/index.scss @@ -6,26 +6,20 @@ img { // transform: rotate(-90deg); } - background: linear-gradient( - 135deg, - hsla(0, 0%, 31%, 1) 0%, - hsla(0, 0%, 0%, 1) 100% - ); - background: -moz-linear-gradient( - 135deg, - hsla(0, 0%, 31%, 1) 0%, - hsla(0, 0%, 0%, 1) 100% - ); - background: -webkit-linear-gradient( - 135deg, - hsla(0, 0%, 31%, 1) 0%, - hsla(0, 0%, 0%, 1) 100% - ); + background: black; .footer { position: fixed; bottom: 0px; left: 0px; } + button { + margin-top: 25px; + background-color: #84de56; + color: white; + padding: 10px 0px; + border: 0px; + border-radius: 10px; + } } @media screen and (min-width: 1441px) { @@ -34,11 +28,11 @@ width: 410px; b { color: white; - font-size: 20px; + font-size: 16px; margin-bottom: 30px; font-weight: 500; + line-height: 1.7; p{ - font-size: 16px; } } input { @@ -46,7 +40,7 @@ background-color: #2a2a2a; border: 1px solid #a2a2a2; border-radius: 8px; - font-size: 23px; + font-size: 20px; padding: 8px 0px; color: white; direction: ltr; @@ -60,17 +54,12 @@ } button { margin-top: 25px; - background-color: #84de56; - color: white; - font-size: 20px; - padding: 10px 0px; - border: 0px; - border-radius: 10px; + font-size: 17px; } } &__info { width: 350px; - margin: 20px auto 0px; + margin: 30px auto 0px; text-align: center; color: white; font-size: 13px; @@ -130,12 +119,7 @@ } button { margin-top: 25px; - background-color: #84de56; - color: white; font-size: calc(100vw / 80); - padding: 10px 0px; - border: 0px; - border-radius: 10px; } } &__info { @@ -206,12 +190,7 @@ } } button { - background-color: #84de56; - color: white; font-size: calc(100vw / 30); - padding: 10px 0px; - border: 0px; - border-radius: 10px; width: 100%; max-width: 400px; margin: 50px auto 0px; @@ -284,8 +263,6 @@ } button { margin-top: 20px; - background-color: #84de56; - color: white; font-size: calc(100vw / 24); padding: 12px 0px; border: 0px; diff --git a/src/views/Course/index.tsx b/src/views/Course/index.tsx index b5973f1..b1a2a3c 100644 --- a/src/views/Course/index.tsx +++ b/src/views/Course/index.tsx @@ -26,7 +26,7 @@ function Course({ lessons, getInfo, info }: any) { useEffect(() => { scroll.goToTop(); getInfo({ - bookId: 18 + bookId: 1 // window.location.pathname.slice( // window.location.pathname.lastIndexOf("/") + 1, // window.location.pathname.length diff --git a/src/views/Faq/index.scss b/src/views/Faq/index.scss index c4ebaf6..1a09475 100644 --- a/src/views/Faq/index.scss +++ b/src/views/Faq/index.scss @@ -44,6 +44,7 @@ &--itemHeader { border-top-right-radius: 5px; border-top-left-radius: 5px; + padding: 10px; strong { color: #4dd35b; } @@ -54,6 +55,7 @@ &--itemBody { border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; + padding:0px 10px 30px; p { color: white; } @@ -66,26 +68,27 @@ header { max-width: 800px; h1 { - font-size: 44px; + font-size: 24px; } p { - font-size: 21px; + font-size: 16px; + margin-bottom: 30px; } input { padding: 10px 20px 10px 0px; - font-size: 21px; + font-size: 17px; } img { - width: 35px; + width: 30px; } } &__list{ max-width: 1040px; - h2{ - font-size: 19px; + strong{ + font-size: 16px; } p{ - font-size: 21px; + font-size: 15px; } } } @@ -96,18 +99,18 @@ header { max-width: 700px; h1 { - font-size: calc(100vw / 50); + font-size: calc(100vw / 55); } p { - font-size: calc(100vw / 90); + font-size: calc(100vw / 95); margin-bottom: 20px; } input { padding: 5px 10px 5px 0px; - font-size: calc(100vw / 90); + font-size: calc(100vw / 95); } img { - width: 35px; + width: 30px; } button{ width: 60px; @@ -121,7 +124,7 @@ font-size: calc(100vw / 95); } p{ - font-size: calc(100vw / 90); + font-size: calc(100vw / 100); } } } diff --git a/src/views/Faq/index.tsx b/src/views/Faq/index.tsx index 1b9791c..5e22944 100644 --- a/src/views/Faq/index.tsx +++ b/src/views/Faq/index.tsx @@ -1,7 +1,7 @@ import React, { useEffect } from "react"; import Navbar from "../../components/Navbar/index"; import Footer from "../../views/Home/Footer/index"; -import search from "../../assets/icons/search.png"; +import searchIcon from "../../assets/icons/search.png"; import dropdown from "../../assets/icons/dropdown.png"; import whiteDropdown from "../../assets/icons/white-dropdown.png"; import { connect } from "react-redux"; @@ -9,7 +9,14 @@ import { faq } from "../../redux/actions"; import scroll from "../../util/scroll.js"; import "./index.scss"; -function Faq({ list, selectFaq, getList }: any) { +function Faq({ + list, + selectFaq, + getList, + searchFaq, + searchResult, + search, +}: any) { useEffect(() => { getList(); scroll.goToTop(); @@ -26,33 +33,59 @@ function Faq({ list, selectFaq, getList }: any) { ستون و سطرآنچنان که لازم است و برای شرایط{" "}

    - + searchFaq(e.target.value)} + />