From d542c25603b870b81199ac67f26e326089e4a8fa Mon Sep 17 00:00:00 2001 From: amir hosein gorji Date: Mon, 20 Sep 2021 04:30:28 +0430 Subject: [PATCH] remove warnings --- public/offline.html | 4 +- src/App.css | 1 + src/AppRouter.js | 3 +- src/Redux/actions/comment.js | 14 +- src/Redux/proxy.js | 7 +- src/Redux/reducers/book.js | 4 +- src/Redux/reducers/comment.js | 1 + src/Redux/reducers/public.js | 2 +- src/Redux/reducers/userFactor.js | 2 +- src/Redux/reducers/userProduct.js | 2 +- src/util/onInput.js | 1 + src/views/AR/BreadCrumb/index.js | 7 - src/views/AR/index.js | 2 +- src/views/Activation/index.js | 4 +- src/views/Auth/Login/Code/index.js | 2 - src/views/Auth/Profile/Document/index.js | 2 - src/views/Auth/Profile/Input/index.js | 3 +- .../Auth/Profile/MultipleSelector/index.js | 2 +- src/views/Auth/Profile/Select/index.js | 5 +- src/views/Auth/Profile/TextArea/index.js | 1 - src/views/Auth/Profile/Upload/index.js | 11 +- src/views/Auth/Profile/index.js | 21 +- src/views/Auth/Splash/ProgressBar/index.js | 20 +- src/views/Blog/BreadCrumb/index.js | 6 - src/views/Blog/index.js | 12 +- src/views/Blog/index.scss | 13 +- src/views/Blogs/BreadCrumb/index.js | 6 - src/views/Cart/DeliveryMethod/index.js | 3 +- src/views/Cart/Factor/index.js | 10 +- src/views/Cart/Table/index.js | 4 +- src/views/Cart/index.js | 11 +- src/views/ChatList/Search/index.js | 16 +- src/views/ChatList/index.js | 67 ++-- src/views/ChatRoom/Body/Input/index.js | 101 +++--- src/views/ChatRoom/Body/Keyboard/index.js | 18 +- .../ChatRoom/Body/Message/Inline/index.js | 18 +- .../Body/Message/MultiSelect/index.js | 31 +- .../ChatRoom/Body/Message/Normal/index.js | 26 +- .../ChatRoom/Body/Message/Select/index.js | 23 +- .../ChatRoom/Body/Message/Slider/index.js | 19 +- src/views/ChatRoom/Body/Message/Sort/index.js | 25 +- src/views/ChatRoom/Body/Message/Tap/index.js | 13 +- src/views/ChatRoom/Body/Message/index.js | 37 ++- src/views/ChatRoom/Body/index.js | 12 +- src/views/ChatRoom/Header/index.js | 2 - src/views/ChatRoom/Info/index.js | 313 +++++++++++------- src/views/Contact/Input/index.js | 13 +- src/views/Contact/Select/index.js | 1 - src/views/Download/BreadCrumb/index.js | 7 - src/views/Download/index.js | 7 +- src/views/Faq/index.js | 3 +- src/views/Home/HomeScroll/index.js | 36 +- src/views/Home/HomeSearch/Select/index.js | 3 +- src/views/Home/HomeSearch/index.js | 2 +- src/views/Home/HomeSlider/Blog/index.js | 19 +- src/views/Home/HomeSlider/Simple/index.js | 2 +- src/views/Home/HomeStatic/Simple/index.js | 2 +- src/views/Home/HomeStatic/index.js | 2 +- src/views/Home/Navbar/Laptop/index.js | 7 +- .../Mobile/NavbarDrawer/NavbarDrawer.js | 54 +-- src/views/Home/Navbar/Mobile/index.js | 16 +- src/views/Home/SingleBlog/index.js | 2 +- src/views/Home/index.js | 6 +- src/views/MyBooks/BreadCrumb/index.js | 7 - src/views/MyBooks/index.js | 2 +- src/views/NewProfile/index.js | 12 +- src/views/Product/AddToCart/index.js | 6 +- src/views/Product/BreadCrumb/index.js | 6 - src/views/Product/Comment/Reply/index.js | 3 +- src/views/Product/Gallery/index.js | 4 +- src/views/Product/Info/index.js | 25 +- src/views/Product/MaterialModal/index.js | 20 +- src/views/Product/index.js | 6 +- src/views/Products/BreadCrumb/index.js | 6 - .../Products/Filters/AppliedFilters/index.js | 2 - .../Products/Filters/TypicalFilters/index.js | 9 +- src/views/Products/List/index.js | 4 +- src/views/Products/Product/index.js | 2 +- src/views/Products/Select/index.js | 2 +- src/views/Products/index.js | 9 - src/views/QR/BookContent/index.js | 3 +- src/views/QR/Image/Modal/index.js | 4 +- src/views/QR/Image/index.js | 17 +- src/views/QR/Links/index.js | 1 - src/views/QR/SubjectsDropdown/index.js | 14 +- .../VideoBox/React-video-js-player/index.js | 2 - src/views/QR/VideoBox/index.js | 1 - src/views/QR/index.js | 5 +- src/views/QRScan/LastQr/index.js | 2 +- src/views/QRScan/index.js | 1 - src/views/Support/Upload/index.js | 85 +++++ src/views/Support/Upload/index.scss | 29 ++ src/views/Support/index.js | 103 ++++-- src/views/Support/index.scss | 278 ++++++++++++++++ 94 files changed, 1112 insertions(+), 647 deletions(-) create mode 100644 src/views/Support/Upload/index.js create mode 100644 src/views/Support/Upload/index.scss create mode 100644 src/views/Support/index.scss diff --git a/public/offline.html b/public/offline.html index b577474..8c6802b 100644 --- a/public/offline.html +++ b/public/offline.html @@ -75,7 +75,9 @@
- لوگو + لوگو دسترسی شما به اینترنت قطع می‌باشد.
diff --git a/src/App.css b/src/App.css index c7181d9..52f780d 100644 --- a/src/App.css +++ b/src/App.css @@ -5,6 +5,7 @@ } #root { height: 100vh; + max-width: 100vw !important; } @font-face { font-family: numeralMedium; diff --git a/src/AppRouter.js b/src/AppRouter.js index 729d02d..d352691 100644 --- a/src/AppRouter.js +++ b/src/AppRouter.js @@ -27,7 +27,6 @@ import MyBooks from "./views/MyBooks/index"; import AR from "./views/AR/index"; import Download from "./views/Download/index"; import Support from "./views/Support/index"; -import Callback from "./views/Callback/index"; import NewProfile from "./views/NewProfile/index"; import Blogs from "./views/Blogs/index"; import Blog from "./views/Blog/index"; @@ -71,7 +70,7 @@ class AppRouter extends Component { console.log({ status, s: this.props.profile }); let home = ( - {status && status.status == 0 ? ( + {status && status.status === 0 ? ( ) : ( diff --git a/src/Redux/actions/comment.js b/src/Redux/actions/comment.js index e2d0fb8..a2225c6 100644 --- a/src/Redux/actions/comment.js +++ b/src/Redux/actions/comment.js @@ -10,18 +10,10 @@ const comment = { await proxy.get("comment/info", data, { dispatch }); }, add: - ( - data = {}, - data2 = { - id: window.location.pathname.slice( - window.location.pathname.lastIndexOf("/") + 1, - window.location.pathname.length - ), - } - ) => + (data = {}, data2) => async (dispatch) => { - await proxy.post("comment/add", data); - await proxy.get("book/info", data2, { dispatch }); + await proxy.post("comment/add", data, { dispatch }); + if (data2) await proxy.get("book/info", data2, { dispatch }); }, del: (data = {}, data2 = {}) => diff --git a/src/Redux/proxy.js b/src/Redux/proxy.js index ff68b68..41a4800 100644 --- a/src/Redux/proxy.js +++ b/src/Redux/proxy.js @@ -2,7 +2,6 @@ import { ApiConfig } from "./../constants/defaultValues"; import axios from "axios"; let { baseUrl } = ApiConfig; -let access = window.localStorage.getItem("access"); window.baseURL = baseUrl; baseUrl = baseUrl + "/"; @@ -45,7 +44,7 @@ class Proxy { check = async (url, { dispatch }, fetch, params) => { dispatch = dispatch || (() => {}); - dispatch({ type: url.split("/")[0] + "/" + "loading" }); + dispatch({ type: `${url.split("/")[0]}/loading` }); let response = await fetch(); switch (response.status) { case 200: @@ -60,7 +59,7 @@ class Proxy { break; default: dispatch({ - type: url.split("/")[0] + "/" + "error", + type: `${url.split("/")[0]}/error`, data: response.data, params, }); @@ -106,7 +105,7 @@ class Proxy { let refresh = localStorage.getItem("refresh"); let userData = localStorage.getItem("userData"); if (!refresh) return false; - if (refresh == "undefined") { + if (refresh === "undefined") { localStorage.removeItem("refresh"); localStorage.removeItem("access"); localStorage.removeItem("userData"); diff --git a/src/Redux/reducers/book.js b/src/Redux/reducers/book.js index 319f441..55ca41c 100644 --- a/src/Redux/reducers/book.js +++ b/src/Redux/reducers/book.js @@ -75,7 +75,7 @@ export default function book(state = initialState, action) { let finalSort; let byLevelFilter = []; if (level.length > 0) { - level.map((item1) => { + level.forEach((item1) => { for (let i = 0; i < realList.length; i++) { if (grades[realList[i].gradeId] === item1) { byLevelFilter.push(realList[i]); @@ -88,7 +88,7 @@ export default function book(state = initialState, action) { let bySubjectFilter = []; if (subject.length > 0) { - subject.map((item1) => { + subject.forEach((item1) => { for (let i = 0; i < byLevelFilter.length; i++) { if (byLevelFilter[i].name === item1) { bySubjectFilter.push(byLevelFilter[i]); diff --git a/src/Redux/reducers/comment.js b/src/Redux/reducers/comment.js index 9e6c0bb..0926b89 100644 --- a/src/Redux/reducers/comment.js +++ b/src/Redux/reducers/comment.js @@ -14,6 +14,7 @@ export default function comment(state = initialState, action) { case "comment/update": return { ...state, loading: false, error: null }; case "comment/add": + toast.success("ثبت درخواست با موفقیت انجام شد"); return { ...state, loading: false, error: null }; case "comment/delete": return { ...state, loading: false, error: null }; diff --git a/src/Redux/reducers/public.js b/src/Redux/reducers/public.js index 4f25ef1..10e2205 100644 --- a/src/Redux/reducers/public.js +++ b/src/Redux/reducers/public.js @@ -92,7 +92,7 @@ export default function publicApi(state = initialState, action) { } let byLevelFilter = []; if (level.length > 0) { - level.map((item1) => { + level.forEach((item1) => { for (let i = 0; i < realList.length; i++) { if (grades[realList[i].book.gradeId] === item1) { byLevelFilter.push(realList[i]); diff --git a/src/Redux/reducers/userFactor.js b/src/Redux/reducers/userFactor.js index 59efb6f..9305921 100644 --- a/src/Redux/reducers/userFactor.js +++ b/src/Redux/reducers/userFactor.js @@ -10,7 +10,7 @@ const initialState = { isVerified: null, }; export default function userFactor(state = initialState, action) { - let { type, data, message } = action; + let { type, data } = action; switch (type) { case "userFactor/list": const checkEmpty = data.filter( diff --git a/src/Redux/reducers/userProduct.js b/src/Redux/reducers/userProduct.js index 7703ef9..09b9c10 100644 --- a/src/Redux/reducers/userProduct.js +++ b/src/Redux/reducers/userProduct.js @@ -11,7 +11,7 @@ const initialState = { myList: [], }; export default function userProduct(state = initialState, action) { - let { type, data, message } = action; + let { type, data } = action; switch (type) { case "userProduct/list": const checkEmpty = data.filter( diff --git a/src/util/onInput.js b/src/util/onInput.js index a42c2f8..2824df9 100644 --- a/src/util/onInput.js +++ b/src/util/onInput.js @@ -1,3 +1,4 @@ +/* eslint-disable no-useless-escape */ import { toast } from "react-toastify"; class onInput { diff --git a/src/views/AR/BreadCrumb/index.js b/src/views/AR/BreadCrumb/index.js index b49bc8b..1790824 100644 --- a/src/views/AR/BreadCrumb/index.js +++ b/src/views/AR/BreadCrumb/index.js @@ -4,13 +4,7 @@ import { Link } from "react-router-dom"; import "./index.scss"; -function handleClick(event) { - event.preventDefault(); - console.info("You clicked a breadcrumb."); -} - const maxDesktopSize = 1250; -const maxMobileSize = 650; const fontSize = { desktop: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 90, @@ -18,7 +12,6 @@ const fontSize = { }; export default function ActiveLastBreadcrumb(props) { - const { name } = props; return ( ({ arList: (state.userProduct.myList || []).filter( - (product) => product.productType == 3 + (product) => product.productType === 3 ), loading: state.loading, }), diff --git a/src/views/Activation/index.js b/src/views/Activation/index.js index 6aaef9d..b5f81d3 100644 --- a/src/views/Activation/index.js +++ b/src/views/Activation/index.js @@ -6,8 +6,7 @@ import Footer from "../Home/Footer/index"; import { Link } from "react-router-dom"; import analytics from "../../assets/icons/analytics.svg"; -import ReplayIcon from "@material-ui/icons/Replay"; -import Scanner from "../QRScan/Scanner/index"; + import qrcode from "~/assets/icons/drawer-qr.png"; import "./index.scss"; @@ -38,7 +37,6 @@ class Activation extends Component { submitAdd() {} render() { - const { data } = this.props; return ( <> {window.innerWidth > 1000 ? ( diff --git a/src/views/Auth/Login/Code/index.js b/src/views/Auth/Login/Code/index.js index 4dbdb7b..a9a68e9 100644 --- a/src/views/Auth/Login/Code/index.js +++ b/src/views/Auth/Login/Code/index.js @@ -1,9 +1,7 @@ import React, { Component } from "react"; -import { Link } from "react-router-dom"; import Timer from "../Timer/index"; import logo from "../../../../assets/icons/logo.png"; -import pic from "../../../../assets/images/pic.png"; import "./index.scss"; diff --git a/src/views/Auth/Profile/Document/index.js b/src/views/Auth/Profile/Document/index.js index 646863c..92fd674 100644 --- a/src/views/Auth/Profile/Document/index.js +++ b/src/views/Auth/Profile/Document/index.js @@ -1,6 +1,4 @@ import React from "react"; -import AddAPhotoIcon from "@material-ui/icons/AddAPhoto"; - import "./index.scss"; const maxDesktopSize = 1250; diff --git a/src/views/Auth/Profile/Input/index.js b/src/views/Auth/Profile/Input/index.js index 878d1ad..bca3634 100644 --- a/src/views/Auth/Profile/Input/index.js +++ b/src/views/Auth/Profile/Input/index.js @@ -19,8 +19,7 @@ export default function FormPropsTextFields(props) { })); const classes = useStyles(); - const { parent, defaultValue, maxLength, inputMode, onInput, variant } = - props; + const { parent, defaultValue, maxLength, onInput, variant } = props; return (
diff --git a/src/views/Auth/Profile/MultipleSelector/index.js b/src/views/Auth/Profile/MultipleSelector/index.js index 5e39055..1b6589f 100644 --- a/src/views/Auth/Profile/MultipleSelector/index.js +++ b/src/views/Auth/Profile/MultipleSelector/index.js @@ -24,7 +24,7 @@ export default function MultipleSelector(props) { })); const classes = useStyles(); - const { parent, defaultValue, name, label, options, selectedOptions } = props; + const { parent, name, label, options, selectedOptions } = props; return ( <> {window.innerWidth < 1000 ? ( diff --git a/src/views/Auth/Profile/Select/index.js b/src/views/Auth/Profile/Select/index.js index 9adf5b0..b013492 100644 --- a/src/views/Auth/Profile/Select/index.js +++ b/src/views/Auth/Profile/Select/index.js @@ -1,13 +1,10 @@ import React from "react"; -import { makeStyles, withStyles } from "@material-ui/core/styles"; +import { makeStyles } from "@material-ui/core/styles"; import FormControl from "@material-ui/core/FormControl"; import Select from "@material-ui/core/Select"; -import InputBase from "@material-ui/core/InputBase"; import KeyboardArrowDownIcon from "@material-ui/icons/KeyboardArrowDown"; import InputLabel from "@material-ui/core/InputLabel"; -const BootstrapInput = withStyles((theme) => ({}))(InputBase); - const useStyles = makeStyles((theme) => ({ marginLeft: { // margin: theme.spacing(1), diff --git a/src/views/Auth/Profile/TextArea/index.js b/src/views/Auth/Profile/TextArea/index.js index a9432c9..2fb4a99 100644 --- a/src/views/Auth/Profile/TextArea/index.js +++ b/src/views/Auth/Profile/TextArea/index.js @@ -13,7 +13,6 @@ const useStyles = makeStyles((theme) => ({ export default function MultilineTextFields(props) { const classes = useStyles(); - const [value, setValue] = React.useState("Controlled"); const { parent, defaultValue } = props; return ( diff --git a/src/views/Auth/Profile/Upload/index.js b/src/views/Auth/Profile/Upload/index.js index 72a7b50..86a3e0c 100644 --- a/src/views/Auth/Profile/Upload/index.js +++ b/src/views/Auth/Profile/Upload/index.js @@ -1,17 +1,8 @@ import React from "react"; import AddAPhotoIcon from "@material-ui/icons/AddAPhoto"; -const maxDesktopSize = 1250; -const maxMobileSize = 550; - -const fontSize = { - desktop: { - span: window.innerWidth > maxDesktopSize ? 14 : window.innerWidth / 80, - }, -}; - export default function Upload(props) { - let { parent, name } = props; + let { parent } = props; return ( <> {window.innerWidth < 1000 ? ( diff --git a/src/views/Auth/Profile/index.js b/src/views/Auth/Profile/index.js index f8eff97..5e4e0ee 100644 --- a/src/views/Auth/Profile/index.js +++ b/src/views/Auth/Profile/index.js @@ -12,7 +12,6 @@ import Birthdate from "./Birthdate/index"; import MultipleSelector from "./MultipleSelector/index"; import Loader from "~/components/Loader/index"; import Document from "./Document/index"; -import logo from "../../../assets/icons/logo.png"; import pic from "../../../assets/images/pic.png"; import "./index.scss"; import { useHistory } from "react-router-dom"; @@ -36,12 +35,6 @@ const fontSize = { }, }; -const toastMessages = { - firstName: "نام وارد شده صحیح نیست!", - lastName: "نام خانوادگی وارد شده صحیح نیست!", - username: "نام کاربری صحیح نیست.", -}; - class Profile extends Component { state = { render: false, @@ -341,7 +334,7 @@ class Profile extends Component { label={"شهر/روستا"} />
*/} - {this.state.status == 1 ? ( + {this.state.status === 1 ? (
) : null} - {this.state.status == 2 ? ( + {this.state.status === 2 ? (
) : null} - {this.state.status == 2 ? ( + {this.state.status === 2 ? ( ) : null}
@@ -489,7 +482,7 @@ class Profile extends Component { selectedOptions={this.state.gradeIds} /> ) : null} - {this.state.status == 1 && Number(this.state.gradeIds) > 9 ? ( + {this.state.status === 1 && Number(this.state.gradeIds) > 9 ? ( ) : null} - {this.state.status == 2 ? ( + {this.state.status === 2 ? ( ) : null} - {this.state.status == 2 ? ( + {this.state.status === 2 ? ( ) : null} 1000 ? (
- { - this.state.percent ? - {this.state.percent}% : null - } + {this.state.percent ? ( + + {this.state.percent}% + + ) : null}
) : null} {window.innerWidth < 1000 ? (
- { - this.state.percent ? - {this.state.percent}% : null - } + {this.state.percent ? ( + + {this.state.percent}% + + ) : null}
) : null} diff --git a/src/views/Blog/BreadCrumb/index.js b/src/views/Blog/BreadCrumb/index.js index 32a062d..bcd4ca6 100644 --- a/src/views/Blog/BreadCrumb/index.js +++ b/src/views/Blog/BreadCrumb/index.js @@ -4,13 +4,7 @@ import { Link } from "react-router-dom"; import "./index.scss"; -function handleClick(event) { - event.preventDefault(); - console.info("You clicked a breadcrumb."); -} - const maxDesktopSize = 1250; -const maxMobileSize = 650; const fontSize = { desktop: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 90, diff --git a/src/views/Blog/index.js b/src/views/Blog/index.js index fc08269..470b6ab 100644 --- a/src/views/Blog/index.js +++ b/src/views/Blog/index.js @@ -3,7 +3,6 @@ import Loader from "~/components/Loader/index"; import Footer from "../Home/Footer/index"; import Navbar from "../Home/Navbar/index"; import BreadCrumb from "./BreadCrumb/index"; -import Image from "../QR/Image/index"; import VideoBox from "../QR/VideoBox/index"; import VoiceBox from "../QR/VoiceBox/index"; @@ -55,7 +54,6 @@ class Blog extends Component {

{blog.title}

-

{blog.date}
@@ -64,7 +62,7 @@ class Blog extends Component {

- {blog.text} +

@@ -98,7 +96,12 @@ class Blog extends Component {
-

{blog.text}

+

+

+

) : ( @@ -134,6 +137,7 @@ const Identifier = (props) => { ) : null} {data.type === "image" ? ( {data.fileIds} diff --git a/src/views/Blog/index.scss b/src/views/Blog/index.scss index 0ce788f..bc8bd2d 100644 --- a/src/views/Blog/index.scss +++ b/src/views/Blog/index.scss @@ -1,5 +1,6 @@ .portrait-blog { - width: 100vw; + max-width: 95vw !important; + // height: 100vh; padding: 0px 10px; position: relative; @@ -45,6 +46,7 @@ &--image { width: 100%; & img { + max-width: 80vw !important; width: 100%; height: 100%; border-radius: 10px; @@ -60,6 +62,12 @@ font-size: 14px; letter-spacing: -1px; font-family: numeralLight; + & img { + max-width: 80vw !important; + height: 100%; + border-radius: 10px; + margin: 0 auto; + } } } } @@ -113,8 +121,9 @@ &__body { width: 100%; &--image { + margin: auto; width: 100%; - max-height: 300px; + // max-height: 300px; } &--text { margin-top: 40px; diff --git a/src/views/Blogs/BreadCrumb/index.js b/src/views/Blogs/BreadCrumb/index.js index c23689f..0757e44 100644 --- a/src/views/Blogs/BreadCrumb/index.js +++ b/src/views/Blogs/BreadCrumb/index.js @@ -4,13 +4,7 @@ import { Link } from "react-router-dom"; import "./index.scss"; -function handleClick(event) { - event.preventDefault(); - console.info("You clicked a breadcrumb."); -} - const maxDesktopSize = 1250; -const maxMobileSize = 650; const fontSize = { desktop: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 90, diff --git a/src/views/Cart/DeliveryMethod/index.js b/src/views/Cart/DeliveryMethod/index.js index 68619f0..4d2ce65 100644 --- a/src/views/Cart/DeliveryMethod/index.js +++ b/src/views/Cart/DeliveryMethod/index.js @@ -27,8 +27,7 @@ const fontSize = { }; class DeliveryMethod extends Component { render() { - const { data, setTransport, factorInfo, parent, transportId, list } = - this.props; + const { data, setTransport, factorInfo, transportId } = this.props; return ( <> {window.innerWidth > 1000 ? ( diff --git a/src/views/Cart/Factor/index.js b/src/views/Cart/Factor/index.js index d95a6f8..0c94ecb 100644 --- a/src/views/Cart/Factor/index.js +++ b/src/views/Cart/Factor/index.js @@ -1,4 +1,4 @@ -import React, { Component } from "react"; +import React from "react"; import { connect } from "react-redux"; import "./index.scss"; @@ -26,14 +26,6 @@ const fontSize = { }; const Factor = (props) => { - const { list, parent } = props; - const totalPrice = () => { - let total = 0; - for (let i = 0; i < list.length; i++) { - total += list[i].product.price * list[i].count; - } - return total; - }; const { factorInfo } = props; return ( <> diff --git a/src/views/Cart/Table/index.js b/src/views/Cart/Table/index.js index 926965f..af7cf20 100644 --- a/src/views/Cart/Table/index.js +++ b/src/views/Cart/Table/index.js @@ -75,7 +75,7 @@ const fontSize = { function BasicTable(props) { const classes = useStyles(); - const { list, handleCounter, handleDelete, route, factorInfo } = props; + const { list, handleDelete, route, factorInfo } = props; const sum = () => { let total = 0; for (let i = 0; i < list.length; i++) { @@ -181,7 +181,7 @@ function BasicTable(props) { } const Item = (props) => { - const { data, pushToCart, id, route, factorInfo } = props; + const { data, pushToCart, id, route } = props; return ( <> {window.innerWidth < 1000 ? ( diff --git a/src/views/Cart/index.js b/src/views/Cart/index.js index 70c018a..a053c9e 100644 --- a/src/views/Cart/index.js +++ b/src/views/Cart/index.js @@ -11,8 +11,6 @@ import Factor from "./Factor/index"; import Loader from "~/components/Loader/index"; import { Link } from "react-router-dom"; -import sciense_6 from "../../assets/images/sciense-6.png"; - import "./index.scss"; const maxDesktopSize = 1250; @@ -65,7 +63,7 @@ class Cart extends Component { // if (this.props.list.length > 0) { // let wantedId; //should be zero // for (let item of this.props.list) { - // if (item.condition == 2) { + // if (item.condition === 2) { // wantedId = item.id; // break; // } @@ -116,9 +114,8 @@ class Cart extends Component { }; render() { - const { list, payPrice, payMethods, factorInfo, userId, hasPhysical } = - this.props; - if (!factorInfo || list.length == 0) + const { list, payPrice, payMethods, factorInfo, userId } = this.props; + if (!factorInfo || list.length === 0) return (
{window.location.search.includes("NOK") || - this.props.isVerified == false ? ( + this.props.isVerified === false ? (
پرداخت شما با خطا مواجه شد ، لطفا مجدد تلاش نمایید
) : null}
- + جستجو
); -} \ No newline at end of file +} diff --git a/src/views/ChatList/index.js b/src/views/ChatList/index.js index 77b08bf..fab2d2b 100644 --- a/src/views/ChatList/index.js +++ b/src/views/ChatList/index.js @@ -1,30 +1,27 @@ -import React, { Component } from 'react'; -import {Link} from 'react-router-dom'; -import { chat } from '../../Redux/actions'; -import { connect } from 'react-redux'; -import ChatIcon from '@material-ui/icons/Chat'; -import Chat from './Chat/index'; -import Navbar from '../Home/Navbar/index'; -import Search from './Search/index'; -import Chatroom from '../ChatRoom/index'; +import React, { Component } from "react"; +import { Link } from "react-router-dom"; +import { chat } from "../../Redux/actions"; +import { connect } from "react-redux"; +import ChatIcon from "@material-ui/icons/Chat"; +import Chat from "./Chat/index"; +import Navbar from "../Home/Navbar/index"; +import Search from "./Search/index"; +import Chatroom from "../ChatRoom/index"; -import './index.scss'; -import { DesktopWindowsRounded } from '@material-ui/icons'; +import "./index.scss"; class ChatList extends Component { state = { selectedUser: null, - } + }; - componentDidMount() { this.props.list(); } render() { return ( <> - { - window.innerWidth < 1000 ? + {window.innerWidth < 1000 ? (
{this.props.chat_list.map((item, i) => ( @@ -33,35 +30,38 @@ class ChatList extends Component { -
: null - } - { - window.innerWidth > 1000 ? +
+ ) : null} + {window.innerWidth > 1000 ? (
-
- -
+
{this.props.chat_list.map((item, i) => ( - + ))} - +
- { - this.state.selectedUser ? - : + {this.state.selectedUser ? ( + + ) : (

برای شروع روی یک چت کلیک کن

- } - -
: null - } + )} + + ) : null} - ); } } @@ -70,6 +70,5 @@ export default connect( (state) => ({ chat_list: state.chat.list || [], }), - { list : chat.list } + { list: chat.list } )(ChatList); - diff --git a/src/views/ChatRoom/Body/Input/index.js b/src/views/ChatRoom/Body/Input/index.js index 4e7f62d..f9eb3df 100644 --- a/src/views/ChatRoom/Body/Input/index.js +++ b/src/views/ChatRoom/Body/Input/index.js @@ -1,16 +1,16 @@ -import React, { Component } from 'react'; -import AudioReactRecorder from 'audio-react-recorder'; -import MicIcon from '@material-ui/icons/Mic'; -import CheckIcon from '@material-ui/icons/Check'; -import CloseIcon from '@material-ui/icons/Close'; -import AttachmentIcon from '@material-ui/icons/Attachment'; -import TextField from '@material-ui/core/TextField'; -import SendIcon from '@material-ui/icons/Send'; -import EmojiEmotions from '@material-ui/icons/EmojiEmotions'; -import KeyboardIcon from '@material-ui/icons/Keyboard'; -import PhotoCamera from '@material-ui/icons/PhotoCamera'; +import React, { Component } from "react"; +import AudioReactRecorder from "audio-react-recorder"; +import MicIcon from "@material-ui/icons/Mic"; +import CheckIcon from "@material-ui/icons/Check"; +import CloseIcon from "@material-ui/icons/Close"; +import AttachmentIcon from "@material-ui/icons/Attachment"; +import TextField from "@material-ui/core/TextField"; +import SendIcon from "@material-ui/icons/Send"; +import EmojiEmotions from "@material-ui/icons/EmojiEmotions"; +import KeyboardIcon from "@material-ui/icons/Keyboard"; +import PhotoCamera from "@material-ui/icons/PhotoCamera"; -import './index.scss'; +import "./index.scss"; export default class ChatInputs extends Component { state = { emoji: false, @@ -24,7 +24,7 @@ export default class ChatInputs extends Component { cancel, typeText, message, - sendMessage, + addFile, file, addcounter, @@ -45,13 +45,16 @@ export default class ChatInputs extends Component {
- {(recordState === null && message === '' && file === null) || - (recordState && recordState.url && message === '' && file === null) ? ( + {(recordState === null && message === "" && file === null) || + (recordState && + recordState.url && + message === "" && + file === null) ? (
) : null} - {message !== '' || file !== null ? ( -
addcounter()}> + {message !== "" || file !== null ? ( +
addcounter()} + >
) : null} - {recordState === 'start' ? ( + {recordState === "start" ? ( <> -
+
) : null}
- {recordState !== 'start' ? ( + {recordState !== "start" ? (
- {message === '' ? ( + {message === "" ? ( ) : null} @@ -109,15 +128,15 @@ export default class ChatInputs extends Component {
@@ -128,7 +147,7 @@ export default class ChatInputs extends Component { value={message} placeholder="یک پیام بنویسید..." rowsMax={4} - onChange={(e) => typeText('text',e.target.value)} + onChange={(e) => typeText("text", e.target.value)} multiline style={{ marginRight: 5, @@ -137,28 +156,28 @@ export default class ChatInputs extends Component { {this.props.parent.state.emoji ? ( this.props.parent.setState({ emoji: false })} /> ) : ( this.props.parent.setState({ emoji: true })} /> diff --git a/src/views/ChatRoom/Body/Keyboard/index.js b/src/views/ChatRoom/Body/Keyboard/index.js index b458f1e..e06f60f 100644 --- a/src/views/ChatRoom/Body/Keyboard/index.js +++ b/src/views/ChatRoom/Body/Keyboard/index.js @@ -1,10 +1,15 @@ -import React, { Component } from 'react'; -import Carousel from 'react-elastic-carousel'; -import './index.scss'; +import React from "react"; +import Carousel from "react-elastic-carousel"; +import "./index.scss"; export default function Keyboard({ options, action }) { return (
- + {options.map((row, i) => ( ))} @@ -25,7 +30,10 @@ const Row = ({ row, action }) => { const KeyboardItem = ({ item, action }) => { return ( -
action(item)}> +
action(item)} + > {item.text}
); diff --git a/src/views/ChatRoom/Body/Message/Inline/index.js b/src/views/ChatRoom/Body/Message/Inline/index.js index bccb404..7955fb3 100644 --- a/src/views/ChatRoom/Body/Message/Inline/index.js +++ b/src/views/ChatRoom/Body/Message/Inline/index.js @@ -1,36 +1,36 @@ -import React, { Component } from 'react'; -import Avatar from '@material-ui/core/Avatar'; +import React, { Component } from "react"; -import './index.scss'; -import { toast } from 'react-toastify'; +import "./index.scss"; +import { toast } from "react-toastify"; export default class Message2D extends Component { state = { value: this.props.message.value }; click(id) { if (this.props.isActive) { this.setState({ value: id }); - toast.success('ثبت شد'); + toast.success("ثبت شد"); this.props.action(); } } render() { - const { message, user, isSelf, isActive, action } = this.props; + const { message } = this.props; return (
{message.options.map((option, i) => (
{option.map((item, i) => (
this.click(item.id)} > diff --git a/src/views/ChatRoom/Body/Message/MultiSelect/index.js b/src/views/ChatRoom/Body/Message/MultiSelect/index.js index aacd485..a7d78a6 100644 --- a/src/views/ChatRoom/Body/Message/MultiSelect/index.js +++ b/src/views/ChatRoom/Body/Message/MultiSelect/index.js @@ -1,7 +1,6 @@ -import React, { Component } from 'react'; -import ArrowRightAltIcon from '@material-ui/icons/ArrowRightAlt'; -import Avatar from '@material-ui/core/Avatar'; -import { toast } from 'react-toastify'; +import React, { Component } from "react"; +import ArrowRightAltIcon from "@material-ui/icons/ArrowRightAlt"; +import { toast } from "react-toastify"; export default class RadioMessage extends Component { constructor(props) { @@ -19,18 +18,27 @@ export default class RadioMessage extends Component { }; render() { - const { message, user, isSelf, isActive } = this.props; + const { message, isActive } = this.props; return (
{message.options.map((row) => ( - + ))}
{isActive && ( - )}
@@ -53,8 +61,11 @@ const Item = (props) => {
props.handleRadioChange(props.item.name)} style={{ - backgroundColor: props.item.name === props.value ? '#6f42c1' : 'rgb(181 224 252 / 47%)', - color: props.item.name === props.value ? 'white' : 'black', + backgroundColor: + props.item.name === props.value + ? "#6f42c1" + : "rgb(181 224 252 / 47%)", + color: props.item.name === props.value ? "white" : "black", }} > {props.item.name} diff --git a/src/views/ChatRoom/Body/Message/Normal/index.js b/src/views/ChatRoom/Body/Message/Normal/index.js index a782b6d..d6d6472 100644 --- a/src/views/ChatRoom/Body/Message/Normal/index.js +++ b/src/views/ChatRoom/Body/Message/Normal/index.js @@ -52,7 +52,7 @@ export default class NormalMessage extends Component { addcounter, } = this.props; const { messageMenu } = this.state; - const hasavatar = prevUserId != message.userId; + const hasavatar = prevUserId !== message.userId; return (
- {message.type == "text" ? ( + {message.type === "text" ? (

{message.text}

) : null} - {message.type == "voice" ? ( + {message.type === "voice" ? ( ) : null} - {message.type == "image" ? ( + {message.type === "image" ? ( ) : null} - {message.type == "video" ? ( + {message.type === "video" ? ( ) : null} - {message.type == "audio" ? ( + {message.type === "audio" ? (

@@ -183,7 +183,7 @@ export default class NormalMessage extends Component {

) : null} - {message.type == "document" ? ( + {message.type === "document" ? (
- {message.updatedAt != message.createdAt ? ( + {message.updatedAt !== message.createdAt ? ( <> ویرایش در @@ -227,11 +227,13 @@ export default class NormalMessage extends Component { padding: "0 2px", }} > - {isSelf && message.status == 0 && ( + {isSelf && message.status === 0 && ( )} - {isSelf && message.status == 2 && } - {isSelf && message.status == 1 && ( + {isSelf && message.status === 2 && ( + + )} + {isSelf && message.status === 1 && (
{message.options.map((row) => ( - + ))}
{isActive && ( - @@ -46,8 +53,10 @@ const Item = (props) => { onClick={() => props.handleRadioChange(props.item.name)} style={{ backgroundColor: - props.item.name === props.value ? 'rgb(100, 205, 130)' : 'rgba(255, 255, 255, 0.4)', - color: props.item.name === props.value ? 'white' : 'black', + props.item.name === props.value + ? "rgb(100, 205, 130)" + : "rgba(255, 255, 255, 0.4)", + color: props.item.name === props.value ? "white" : "black", }} > {props.item.name} diff --git a/src/views/ChatRoom/Body/Message/Slider/index.js b/src/views/ChatRoom/Body/Message/Slider/index.js index 5458515..9b1bd91 100644 --- a/src/views/ChatRoom/Body/Message/Slider/index.js +++ b/src/views/ChatRoom/Body/Message/Slider/index.js @@ -1,17 +1,16 @@ -import React, { Component } from 'react'; -import Grid from '@material-ui/core/Grid'; -import Slider from '@material-ui/core/Slider'; -import Input from '@material-ui/core/Input'; -import ArrowRightAltIcon from '@material-ui/icons/ArrowRightAlt'; -import Avatar from '@material-ui/core/Avatar'; -import { toast } from 'react-toastify'; +import React, { Component } from "react"; +import Grid from "@material-ui/core/Grid"; +import Slider from "@material-ui/core/Slider"; +import Input from "@material-ui/core/Input"; +import ArrowRightAltIcon from "@material-ui/icons/ArrowRightAlt"; + export default class SliderMessage extends Component { state = { value: this.props.message.value || 0, }; onChange = (value) => { if (!this.props.isActive || !value) return; - const [min, max, step] = this.props.message.options[0] || [0, 100, 1]; + const [min, max] = this.props.message.options[0] || [0, 100, 1]; this.setState({ value: Math.min(max, Math.max(min, parseFloat(value))) }); }; @@ -44,8 +43,8 @@ export default class SliderMessage extends Component { step: step, min: min, max: max, - type: 'number', - 'aria-labelledby': 'input-slider', + type: "number", + "aria-labelledby": "input-slider", }} /> diff --git a/src/views/ChatRoom/Body/Message/Sort/index.js b/src/views/ChatRoom/Body/Message/Sort/index.js index 99df8c5..ec6c712 100644 --- a/src/views/ChatRoom/Body/Message/Sort/index.js +++ b/src/views/ChatRoom/Body/Message/Sort/index.js @@ -1,9 +1,7 @@ -import React, { Component, useEffect } from 'react'; -import { SortableContainer, SortableElement } from 'react-sortable-hoc'; -import arrayMove from 'array-move'; -import ArrowRightAltIcon from '@material-ui/icons/ArrowRightAlt'; -import Avatar from '@material-ui/core/Avatar'; -import { toast } from 'react-toastify'; +import React, { Component } from "react"; +import { SortableContainer, SortableElement } from "react-sortable-hoc"; +import arrayMove from "array-move"; +import ArrowRightAltIcon from "@material-ui/icons/ArrowRightAlt"; export default class DraggableMessage extends Component { constructor(props) { @@ -18,11 +16,15 @@ export default class DraggableMessage extends Component { }; render() { - const { message, user, isSelf, isActive, action } = this.props; + const { isActive, action } = this.props; return (
- + {isActive && ( ); diff --git a/src/views/ChatRoom/Body/Message/index.js b/src/views/ChatRoom/Body/Message/index.js index 4b13c79..67ac9aa 100644 --- a/src/views/ChatRoom/Body/Message/index.js +++ b/src/views/ChatRoom/Body/Message/index.js @@ -1,14 +1,13 @@ -import React, { Component } from 'react'; -import Normal from './Normal'; -import Inline from './Inline'; -import Sort from './Sort'; -import Slider from './Slider'; -import Select from './Select'; -import MultiSelect from './MultiSelect'; -import Tap from './Tap'; -import ArrowRightAltIcon from '@material-ui/icons/ArrowRightAlt'; +import React, { Component } from "react"; +import Normal from "./Normal"; +import Inline from "./Inline"; +import Sort from "./Sort"; +import Slider from "./Slider"; +import Select from "./Select"; +import MultiSelect from "./MultiSelect"; +import Tap from "./Tap"; -import './index.scss'; +import "./index.scss"; const types = { sort: Sort, inline: Inline, @@ -19,7 +18,16 @@ const types = { }; export default class Message extends Component { render() { - const { message, user, isSelf, file, document, prevUserId, isActive, addcounter } = this.props; + const { + message, + user, + isSelf, + file, + document, + prevUserId, + isActive, + addcounter, + } = this.props; const Action = types[message.action]; return (
@@ -33,7 +41,12 @@ export default class Message extends Component { document={document} > {Action ? ( - + ) : null} {/* {isActive && ( +
); @@ -109,5 +113,5 @@ export default connect( info: state.book.info, id: state.user.status.id, }), - { addComment: comment.add, getInfo: book.info } + { addComment: comment.add } )(SimpleModal); diff --git a/src/views/Product/index.js b/src/views/Product/index.js index f889070..b96d92a 100644 --- a/src/views/Product/index.js +++ b/src/views/Product/index.js @@ -80,7 +80,7 @@ class Product extends Component { } render() { - const { product, supportItems, info, page } = this.props; + const { supportItems, info, page } = this.props; return ( <> {window.innerWidth > 1000 ? ( @@ -351,10 +351,6 @@ Product.defaultProps = { ], }; -const Item = (props) => { - return
  • + {props.item}
  • ; -}; - const Identifier = (props) => { return ( <> diff --git a/src/views/Products/BreadCrumb/index.js b/src/views/Products/BreadCrumb/index.js index 7293956..7bcfbda 100644 --- a/src/views/Products/BreadCrumb/index.js +++ b/src/views/Products/BreadCrumb/index.js @@ -4,13 +4,7 @@ import { Link } from "react-router-dom"; import "./index.scss"; -function handleClick(event) { - event.preventDefault(); - console.info("You clicked a breadcrumb."); -} - const maxDesktopSize = 1250; -const maxMobileSize = 650; const fontSize = { desktop: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 90, diff --git a/src/views/Products/Filters/AppliedFilters/index.js b/src/views/Products/Filters/AppliedFilters/index.js index c0cca64..76dc916 100644 --- a/src/views/Products/Filters/AppliedFilters/index.js +++ b/src/views/Products/Filters/AppliedFilters/index.js @@ -3,8 +3,6 @@ import CloseIcon from "@material-ui/icons/Close"; import "./index.scss"; -const maxDesktopSize = 1250; - const fontSize = { h2: 15, //window.innerWidth > maxDesktopSize ? 13 : window.innerWidth / 85, button: 15, //window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 85, diff --git a/src/views/Products/Filters/TypicalFilters/index.js b/src/views/Products/Filters/TypicalFilters/index.js index 2126e3d..8217982 100644 --- a/src/views/Products/Filters/TypicalFilters/index.js +++ b/src/views/Products/Filters/TypicalFilters/index.js @@ -4,16 +4,9 @@ import Checkbox from "@material-ui/core/Checkbox"; import CheckBoxOutlineBlankIcon from "@material-ui/icons/CheckBoxOutlineBlank"; import CheckBoxIcon from "@material-ui/icons/CheckBox"; -import CloseIcon from "@material-ui/icons/Close"; import "./index.scss"; -const maxDesktopSize = 1250; - -const fontSize = { - h2: window.innerWidth > maxDesktopSize ? 13 : window.innerWidth / 85, - strong: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 90, -}; export default class TypicalFilters extends React.Component { onChange = (name, data) => { if (name === "subject") { @@ -41,7 +34,7 @@ export default class TypicalFilters extends React.Component { } }; render() { - const { data, title, theme, name, parent } = this.props; + const { data, title, theme } = this.props; return (
    diff --git a/src/views/Products/List/index.js b/src/views/Products/List/index.js index c8a5c83..4621756 100644 --- a/src/views/Products/List/index.js +++ b/src/views/Products/List/index.js @@ -9,11 +9,11 @@ import "./index.scss"; class List extends React.Component { componentDidMount() { - if (this.props.list.length == 0) this.props.getList(); + if (this.props.list.length === 0) this.props.getList(); } render() { - let { list, filterResult, loading } = this.props; + let { filterResult, loading } = this.props; return window.innerWidth > 1000 ? (
    diff --git a/src/views/Products/Product/index.js b/src/views/Products/Product/index.js index ad57e86..9294f37 100644 --- a/src/views/Products/Product/index.js +++ b/src/views/Products/Product/index.js @@ -27,7 +27,7 @@ const grades = [ class Product extends Component { render() { - const { product, id } = this.props; + const { product } = this.props; return ( <> diff --git a/src/views/Products/Select/index.js b/src/views/Products/Select/index.js index e22089d..8b972ce 100644 --- a/src/views/Products/Select/index.js +++ b/src/views/Products/Select/index.js @@ -63,7 +63,7 @@ export default function CustomizedSelects(props) { : props.parent.setState({ selectedFilters: { ...props.parent.state.selectedFilters, - [props.name]: props.name === "sort" ? null : new Array(), + [props.name]: props.name === "sort" ? null : [], }, }) } diff --git a/src/views/Products/index.js b/src/views/Products/index.js index d64561d..ceffe7a 100644 --- a/src/views/Products/index.js +++ b/src/views/Products/index.js @@ -6,7 +6,6 @@ import { Link } from "react-router-dom"; import Navbar from "../Home/Navbar/index"; import Footer from "../Home/Footer/index"; import Select from "./Select/index"; -import Product from "./Product/index"; import Breadcrumbs from "./BreadCrumb/index"; import List from "./List/index"; import Sort from "./Sort/index"; @@ -17,14 +16,6 @@ import navbarSearch from "../../assets/icons/navbarSearch.png"; import "./index.scss"; import { toast } from "react-toastify"; -const maxMobileSize = 1250; - -const fontSize = { - mobile: { - input: window.innerWidth > maxMobileSize ? 14 : window.innerWidth / 27, - }, -}; - class Products extends Component { state = { search: null, diff --git a/src/views/QR/BookContent/index.js b/src/views/QR/BookContent/index.js index ad5fdad..c40b3c5 100644 --- a/src/views/QR/BookContent/index.js +++ b/src/views/QR/BookContent/index.js @@ -1,6 +1,5 @@ -import React, { Component, useState } from "react"; +import React from "react"; -import ppt from "../../../assets/icons/ppt.svg"; import MaterialAudioPlayer from "../VoiceBox/Material-audio-player/index"; import "./index.scss"; diff --git a/src/views/QR/Image/Modal/index.js b/src/views/QR/Image/Modal/index.js index 104d831..440473a 100644 --- a/src/views/QR/Image/Modal/index.js +++ b/src/views/QR/Image/Modal/index.js @@ -42,7 +42,7 @@ export default function Modal(props) { >
    - +
    handleNavigation("left", selectedImage)} @@ -75,7 +75,7 @@ export default function Modal(props) { >
    - +
    handleNavigation("left", selectedImage)} diff --git a/src/views/QR/Image/index.js b/src/views/QR/Image/index.js index ef0cb11..6cf0c37 100644 --- a/src/views/QR/Image/index.js +++ b/src/views/QR/Image/index.js @@ -1,4 +1,4 @@ -import React, { Component, useState } from "react"; +import React, { useState } from "react"; import Modal from "./Modal/index"; import PhotoLibraryRoundedIcon from "@material-ui/icons/PhotoLibraryRounded"; @@ -46,6 +46,7 @@ export default function QRImage(props) { // onClick={() => setOpen(true)} > {list[0]} setOpen(true)} @@ -59,11 +60,13 @@ export default function QRImage(props) { // onClick={() => setOpen(true)} > {list[0]} setOpen(true)} /> {list[1]} setOpen(true)} @@ -75,6 +78,7 @@ export default function QRImage(props) {
    {list[0]} setOpen(true)} /> @@ -88,6 +92,7 @@ export default function QRImage(props) { +{list.length - 2} {list[1]} @@ -112,6 +117,7 @@ export default function QRImage(props) { // onClick={() => setOpen(true)} > {list[0]} setOpen(true)} @@ -125,11 +131,13 @@ export default function QRImage(props) { // onClick={() => setOpen(true)} > {list[0]} setOpen(true)} /> {list[1]} setOpen(true)} @@ -143,16 +151,19 @@ export default function QRImage(props) { // onClick={() => setOpen(true)} > {list[0]} setOpen(true)} /> {list[1]} setOpen(true)} /> {list[2]} setOpen(true)} @@ -164,12 +175,14 @@ export default function QRImage(props) {
    {list[0]} setOpen(true)} />
    {list[1]} setOpen(true)} /> @@ -182,7 +195,7 @@ export default function QRImage(props) { > +{list.length - 3} - + {list[2]}
    {open ? ( { - let fakeList = props.subjects.filter((item) => item.name.search(val) !== -1); + let fakeList = props.subjects.filter( + (item) => item.name.search(val) !== -1 + ); setSearchedSubjects(fakeList); setSearch(val); }; @@ -50,7 +50,11 @@ export default function Dropdown(props) { {dropdown ? ( <>
    - handleSearch(e.target.value)} /> + handleSearch(e.target.value)} + /> جستجو
      diff --git a/src/views/QR/VideoBox/React-video-js-player/index.js b/src/views/QR/VideoBox/React-video-js-player/index.js index 86d09d6..2c3220a 100644 --- a/src/views/QR/VideoBox/React-video-js-player/index.js +++ b/src/views/QR/VideoBox/React-video-js-player/index.js @@ -1,6 +1,4 @@ import React, { Component } from "react"; -import VideoPlayer from "react-video-js-player"; -import film from "../../../../assets/Video/film.mp4"; import "./index.scss"; class VideoApp extends Component { diff --git a/src/views/QR/VideoBox/index.js b/src/views/QR/VideoBox/index.js index dbe3151..d3d813c 100644 --- a/src/views/QR/VideoBox/index.js +++ b/src/views/QR/VideoBox/index.js @@ -1,5 +1,4 @@ import React from "react"; -import { VideoCard } from "material-ui-player"; import ReactVideoJsPlayer from "./React-video-js-player/index"; import PlayCircleFilledRoundedIcon from "@material-ui/icons/PlayCircleFilledRounded"; diff --git a/src/views/QR/index.js b/src/views/QR/index.js index f63d5ba..5ae15a0 100644 --- a/src/views/QR/index.js +++ b/src/views/QR/index.js @@ -1,3 +1,4 @@ +/* eslint-disable jsx-a11y/anchor-has-content */ import React, { Component } from "react"; import { Link } from "react-router-dom"; import Navbar from "../Home/Navbar/index"; @@ -9,9 +10,7 @@ import VideoBox from "./VideoBox/index"; import PDF from "./PDF/index"; import PowerPoint from "./PowerPoint/index"; import Links from "./Links/index"; -import SubjectsDropdown from "./SubjectsDropdown/index"; import BookContent from "./BookContent/index"; -import NightsStayOutlinedIcon from "@material-ui/icons/NightsStayOutlined"; import MoreVertIcon from "@material-ui/icons/MoreVert"; import { connect } from "react-redux"; @@ -90,7 +89,7 @@ class QR extends Component { } render() { - const { QR, qrList, loading } = this.props; + const { qrList, loading } = this.props; const fontSize = { desktop: { sidebar: { diff --git a/src/views/QRScan/LastQr/index.js b/src/views/QRScan/LastQr/index.js index b5d2543..3615974 100644 --- a/src/views/QRScan/LastQr/index.js +++ b/src/views/QRScan/LastQr/index.js @@ -1,4 +1,4 @@ -import React, { Component } from "react"; +import React from "react"; import { Link } from "react-router-dom"; import "./index.scss"; diff --git a/src/views/QRScan/index.js b/src/views/QRScan/index.js index f00a44c..540725d 100644 --- a/src/views/QRScan/index.js +++ b/src/views/QRScan/index.js @@ -1,7 +1,6 @@ import React, { Component } from "react"; import Navbar from "../Home/Navbar/index"; import Footer from "../Home/Footer/index"; -import { Link } from "react-router-dom"; import Scanner from "./Scanner/index"; import LastQr from "./LastQr/index"; diff --git a/src/views/Support/Upload/index.js b/src/views/Support/Upload/index.js new file mode 100644 index 0000000..1ece268 --- /dev/null +++ b/src/views/Support/Upload/index.js @@ -0,0 +1,85 @@ +import React from "react"; + +import "./index.scss"; + +const maxDesktopSize = 1250; +const maxMobileSize = 550; + +const fontSize = { + desktop: { + span: window.innerWidth > maxDesktopSize ? 14 : window.innerWidth / 80, + }, + mobile: { + span: window.innerWidth > maxMobileSize ? 14 : window.innerWidth / 30, + }, +}; + +export default function Document(props) { + const { parent, name } = props; + console.log({ parent, name }); + return ( + <> + {window.innerWidth < 1000 ? ( +
      + + parent.onChange(e.target.name, e.target.files[0], "file") + } + /> + {parent.state.file ? ( + + {parent.state.file?.name || "تصویر بارگزاری شد"} + + ) : ( + + در صورت نیاز تصویر مرتبط را انتخاب کنید. + + )} +
      + ) : null} + {window.innerWidth > 1000 ? ( +
      + + parent.onChange(e.target.name, e.target.files[0], "file") + } + />{" "} + {parent.state.file ? ( + + {parent.state.file?.name || "فایل ثبت شد"} + + ) : ( + + در صورت نیاز تصویر مرتبط را انتخاب کنید. + + )} +
      + ) : null} + + ); +} diff --git a/src/views/Support/Upload/index.scss b/src/views/Support/Upload/index.scss new file mode 100644 index 0000000..a1ff257 --- /dev/null +++ b/src/views/Support/Upload/index.scss @@ -0,0 +1,29 @@ +.support { + &__document { + color: gray !important; + margin: 10px auto; + width: 100%; + height: 50px; + border-radius: 10px; + border: 2px dashed #d1d1d1; + position: relative; + input { + width: 100%; + height: 100%; + position: absolute; + left: 0px; + top: 0px; + opacity: 0; + } + img { + width: 100%; + height: 100%; + object-fit: cover; + border-radius: 50%; + } + span { + color: #afafaf; + font-family: numeralLight; + } + } +} diff --git a/src/views/Support/index.js b/src/views/Support/index.js index 350a164..fb2d6d9 100644 --- a/src/views/Support/index.js +++ b/src/views/Support/index.js @@ -1,11 +1,12 @@ import React, { Component } from "react"; -import { userProduct } from "~/Redux/actions"; +import { userProduct, comment, file } from "~/Redux/actions"; import Navbar from "../Home/Navbar/index"; + import Input from "../Contact/Input/index"; import Select from "../Contact/Select/index"; - -import "../Contact/index.scss"; +import Upload from "./Upload"; +import "./index.scss"; import { connect } from "react-redux"; const maxDesktopSize = 1250; @@ -29,48 +30,94 @@ class Support extends Component { name: null, cellphone: null, unit: null, - book: null, + bookId: null, subject: null, text: null, + file: null, + fileId: null, }; componentDidMount() { - console.log(this.props); - // this.props?.getList(); + if (!this.props.myProductList) this.props.getUserProductList({}); + } + onChange = (name, value, type) => { + if (type === "file") { + this.props.upload({ file: value, target: name }); + } + this.setState({ + [name]: value, + }); + }; + async send() { + const { + submit, + status: { userId }, + } = this.props; + const { text, fileId, name, cellphone, unit, bookId, subject } = this.state; + await submit({ + fileId, + text, + name, + cellphone, + unit, + bookId, + subject, + userId, + }); + //todo redirectHome } - render() { + let { status } = this.props; return ( <> -
      - -
      +
      + +

      پشتیبانی

      - {/* - */} + {status ? null : ( + <> + + + + )} item.product.book.name) || [] + this.props.myProductList?.map( + (item) => item.product.book.name + ) || [] ), ]} parent={this} /> ) : null} - - - + + + {/* */} + + this.addFile(e)} + parent={this} + name="file" + /> + +
      @@ -80,7 +127,13 @@ class Support extends Component { export default connect( (state) => ({ - list: state.userProduct.mylist || [], + myProductList: state.userProduct.mylist || [], + status: state.user.status, + uploadFileId: state.file.supportFileId, }), - { getList: userProduct.mylist } + { + getUserProductList: userProduct.mylist, + submit: comment.add, + upload: file.upload, + } )(Support); diff --git a/src/views/Support/index.scss b/src/views/Support/index.scss new file mode 100644 index 0000000..92fa3c7 --- /dev/null +++ b/src/views/Support/index.scss @@ -0,0 +1,278 @@ +.support { + width: 100vw; + max-width: 1250px; + margin: 0px auto; + padding: 0px 10px; + direction: rtl; + min-height: calc(100vh - 288px); + overflow-x: hidden; + padding-top: 60px; + &__forms { + width: 100%; + justify-content: space-between; + margin-top: 30px; + margin-bottom: 80px; + &--right { + width: 45%; + .MuiOutlinedInput-notchedOutline { + top: 0px !important; + } + .MuiOutlinedInput-notchedOutline { + border-color: #cecece !important; + border-width: 1px !important; + color: green !important; + border-radius: 10px !important; + } + + .MuiOutlinedInput-input { + padding: 20px 14px !important; + font-size: calc(100vw / 85) !important; + } + .MuiInputLabel-outlined { + font-family: numeralLight !important; + display: inline !important; + position: absolute; + text-align: right !important; + right: 10px; + top: 12px; + padding: 0px !important; + transform: translate(0px, 0px) scale(1) !important; + } + .MuiInputLabel-shrink { + text-align: right !important; + display: inline; + position: absolute; + right: -5px; + top: -8px; + transform: translate(0px, 0px) scale(0.75) !important; + padding-right: 15px !important; + } + + label { + background-color: white; + max-width: 120px; + text-align: center; + color: #797979 !important; + letter-spacing: -1px; + } + .Mui-focused { + color: rgba(0, 0, 0, 0.54) !important; + border-color: #c4c4c5 !important; + } + h1 { + letter-spacing: -2px; + color: #6cbe44; + font-family: numeralMedium; + font-size: calc(100vw / 40); + } + p { + font-family: numeralLight; + font-size: calc(100vw / 95); + color: #6f7074; + } + + button { + align-self: flex-start; + margin-top: 30px; + font-family: numeralLight; + text-decoration: none; + color: white; + background-color: #6cbe44; + border-radius: 6px; + padding: 5px 25px; + font-size: calc(100vw / 90); + max-width: 110px; + border: 0px; + &:hover { + color: white; + } + } + + .MuiFormControl-root { + select { + font-family: numeralLight; + height: 100%; + direction: rtl; + border: 1px solid #cecece !important; + text-align: center !important; + border-radius: 10px !important; + color: #76797e !important; + &:focus { + background-color: white !important; + } + option { + padding: 5px !important; + } + } + .MuiNativeSelect-icon { + display: none; + } + .MuiNativeSelect-select { + padding: 8px 10px 8px 100px !important; + } + } + } + &--left { + width: 45%; + height: 100%; + p { + font-family: numeralLight; + font-size: calc(100vw / 95); + margin-bottom: 0px; + color: #6f7074; + } + span { + font-family: numeralLight; + font-size: calc(100vw / 95); + margin-bottom: 0px; + color: #6f7074; + margin-right: 5px; + } + .contact__map { + width: 100%; + height: 430px; + border-radius: 20px; + img { + transform: scale(0.4); + } + } + } + } +} + +.mobile-support { + width: 100vw; + max-width: 550px; + margin: 0px auto; + padding: 0px 10px; + direction: rtl; + overflow-x: hidden; + padding-top: 70px; + padding-bottom: 50px; + &__form { + width: 100%; + justify-content: space-between; + margin-top: 20px; + margin-bottom: 20px; + + .MuiOutlinedInput-notchedOutline { + top: 0px !important; + } + .MuiOutlinedInput-notchedOutline { + border-color: #cecece !important; + border-width: 1px !important; + color: green !important; + border-radius: 10px !important; + } + + .MuiOutlinedInput-input { + padding: 20px 14px !important; + } + .MuiInputLabel-outlined { + font-family: numeralLight !important; + display: inline !important; + position: absolute; + text-align: right !important; + right: 10px; + top: 12px; + padding: 0px !important; + transform: translate(0px, 0px) scale(1) !important; + } + .MuiInputLabel-shrink { + text-align: right !important; + display: inline; + position: absolute; + right: -5px; + top: -8px; + transform: translate(0px, 0px) scale(0.75) !important; + padding-right: 0px !important; + width: fit-content; + padding: 0px 6px !important; + } + + label { + background-color: white; + max-width: 120px; + text-align: center; + color: #797979 !important; + letter-spacing: -1px; + font-family: numeralLight !important; + font-size: 14px; + } + .Mui-focused { + color: rgba(0, 0, 0, 0.54) !important; + border-color: #c4c4c5 !important; + } + h1 { + letter-spacing: -2px; + color: #6cbe44; + font-family: numeralMedium; + } + p { + font-family: numeralLight; + color: #6f7074; + } + + button { + align-self: flex-start; + margin-top: 30px; + font-family: numeralLight; + text-decoration: none; + color: white; + background-color: #6cbe44; + border-radius: 6px; + padding: 8px 25px; + width: 100%; + border: 0px; + &:hover { + color: white; + } + } + + .MuiFormControl-root { + select { + font-family: numeralLight; + height: 100%; + direction: rtl; + border: 1px solid #cecece !important; + text-align: center !important; + border-radius: 10px !important; + color: #76797e !important; + &:focus { + background-color: white !important; + } + option { + padding: 5px !important; + } + } + .MuiNativeSelect-icon { + display: none; + } + .MuiNativeSelect-select { + padding: 8px 10px 8px 100px !important; + } + } + } + &__address { + width: 100%; + p { + font-family: numeralLight; + margin-bottom: 0px; + color: #6f7074; + } + span { + font-family: numeralLight; + margin-bottom: 0px; + color: #6f7074; + margin-right: 5px; + } + &--map { + width: 100%; + height: 180px; + border-radius: 20px; + img { + transform: scale(0.4); + } + } + } +}