From abaa0c00e84ea5fc101c9a559d4047f2116b42f7 Mon Sep 17 00:00:00 2001 From: RezaAshrafi77 Date: Sat, 28 Aug 2021 20:56:11 +0430 Subject: [PATCH] reza added very feather --- src/App.css | 7 +- src/AppRouter.js | 2 +- src/Redux/actions/comment.js | 40 +++ src/Redux/actions/index.js | 1 + src/Redux/reducers/comment.js | 34 +++ src/Redux/reducers/index.js | 1 + src/Redux/reducers/user.js | 4 + src/Redux/reducers/userProduct.js | 12 +- src/assets/icons/image.jpg | Bin 0 -> 12203 bytes src/util/onInput.js | 274 ++++++++++++++++++ src/views/AR/BreadCrumb/index.js | 45 +++ src/views/AR/BreadCrumb/index.scss | 8 + src/views/AR/index.js | 5 +- src/views/Auth/Profile/Birthdate/index.js | 25 +- src/views/Auth/Profile/index.js | 117 +++----- src/views/Contact/Input/index.js | 23 +- src/views/Contact/Select/index.js | 27 +- src/views/Contact/index.js | 49 +++- src/views/Contact/index.scss | 3 +- src/views/Home/HomeStatic/Flex/index.js | 2 +- .../Mobile/NavbarDrawer/NavbarDrawer.js | 66 ++--- src/views/Home/Navbar/Mobile/index.js | 4 +- src/views/MyBooks/BreadCrumb/index.js | 2 +- src/views/MyBooks/index.js | 49 +++- src/views/MyBooks/index.scss | 17 +- src/views/Product/Comment/index.js | 2 +- src/views/Product/MaterialModal/index.js | 37 ++- src/views/Product/index.js | 15 +- src/views/Product/index.scss | 5 +- src/views/Products/Product/index.js | 7 +- src/views/Products/index.scss | 15 + src/views/QR/Image/index.js | 4 +- .../VideoBox/React-video-js-player/index.scss | 4 +- src/views/QR/VideoBox/index.scss | 6 +- src/views/QR/index.js | 26 +- src/views/QR/index.scss | 5 + src/views/QRScan/LastQr/index.js | 56 ++-- src/views/QRScan/LastQr/index.scss | 34 ++- src/views/QRScan/index.js | 17 +- src/views/QRScan/index.scss | 42 +-- src/views/Support/index.js | 55 +++- 41 files changed, 857 insertions(+), 290 deletions(-) create mode 100644 src/Redux/actions/comment.js create mode 100644 src/Redux/reducers/comment.js create mode 100644 src/assets/icons/image.jpg create mode 100644 src/util/onInput.js create mode 100644 src/views/AR/BreadCrumb/index.js create mode 100644 src/views/AR/BreadCrumb/index.scss diff --git a/src/App.css b/src/App.css index 7e6d352..534a887 100644 --- a/src/App.css +++ b/src/App.css @@ -1,10 +1,7 @@ - - - - * { box-sizing: border-box !important; - direction: rtl; + direction: rtl; + font-family: numeralLight; } @font-face { diff --git a/src/AppRouter.js b/src/AppRouter.js index 16fb2fb..ed081a3 100644 --- a/src/AppRouter.js +++ b/src/AppRouter.js @@ -43,7 +43,7 @@ class AppRouter extends Component { const mobile = window.innerWidth < 1000 ? true : false; let home = mobile ? ( - {proxy.status() ? ( + {proxy.status ? ( this.props.profile ? ( ) : ( diff --git a/src/Redux/actions/comment.js b/src/Redux/actions/comment.js new file mode 100644 index 0000000..e2d0fb8 --- /dev/null +++ b/src/Redux/actions/comment.js @@ -0,0 +1,40 @@ +import proxy from "../proxy"; +const comment = { + list: + (data = {}) => + async (dispatch) => + await proxy.get("comment/list", data, { dispatch }), + info: + (data = {}) => + async (dispatch) => { + await proxy.get("comment/info", data, { dispatch }); + }, + add: + ( + data = {}, + data2 = { + id: window.location.pathname.slice( + window.location.pathname.lastIndexOf("/") + 1, + window.location.pathname.length + ), + } + ) => + async (dispatch) => { + await proxy.post("comment/add", data); + await proxy.get("book/info", data2, { dispatch }); + }, + del: + (data = {}, data2 = {}) => + async (dispatch) => { + await proxy.delete("ar/delete", data); + await proxy.get("ar/list", data2, { dispatch }); + }, + update: + (data = {}, data2 = {}) => + async (dispatch) => { + await proxy.put("ar/update", data); + await proxy.get("ar/list", data2, { dispatch }); + }, +}; + +export default comment; diff --git a/src/Redux/actions/index.js b/src/Redux/actions/index.js index 090cb86..00e0510 100644 --- a/src/Redux/actions/index.js +++ b/src/Redux/actions/index.js @@ -8,3 +8,4 @@ export { default as qr } from "./qr.js"; export { default as book } from "./book.js"; export { default as userProduct } from "./userProduct.js"; export { default as transport } from "./transport.js"; +export { default as comment } from "./comment.js"; diff --git a/src/Redux/reducers/comment.js b/src/Redux/reducers/comment.js new file mode 100644 index 0000000..069fa0c --- /dev/null +++ b/src/Redux/reducers/comment.js @@ -0,0 +1,34 @@ +import { toast } from "react-toastify"; + +const initialState = { + loading: false, + error: null, + list: null, +}; + +export default function comment(state = initialState, action) { + let { type, data } = action; + switch (type) { + case "comment/list": + return { ...state, loading: false, error: null }; + case "comment/update": + return { ...state, loading: false, error: null }; + case "comment/add": + return { ...state, loading: false, error: null }; + case "comment/delete": + return { ...state, loading: false, error: null }; + case "comment/info": + return { + ...state, + loading: false, + list: data, + error: null, + }; + case "loading": + return { ...state, loading: true }; + case "error": + return { ...state, loading: false, error: data.message }; + default: + return state; + } +} diff --git a/src/Redux/reducers/index.js b/src/Redux/reducers/index.js index 6491242..67acb5d 100644 --- a/src/Redux/reducers/index.js +++ b/src/Redux/reducers/index.js @@ -8,3 +8,4 @@ export { default as qr } from "./qr.js"; export { default as book } from "./book.js"; export { default as userProduct } from "./userProduct.js"; export { default as transport } from "./transport.js"; +export { default as comment } from "./comment.js"; diff --git a/src/Redux/reducers/user.js b/src/Redux/reducers/user.js index cfbc526..825cfab 100644 --- a/src/Redux/reducers/user.js +++ b/src/Redux/reducers/user.js @@ -16,8 +16,10 @@ export default function user(state = initialState, action) { case "user/register": case "user/switchRole": case "public/sendOTP": + toast.success("کد به شماره شما ارسال گردید."); return { ...state, loading: false, status: data.profile, error: null }; case "user/otp/login": + toast.success("به دانوین خوش آمدید."); return { ...state, loading: false, @@ -38,6 +40,8 @@ export default function user(state = initialState, action) { case "mothers/list": return { ...state, loading: false, mothers: data, error: null }; case "user/setProfile": + toast.success("تغییرات اعمال شد."); + window.location = "/"; return { ...state, loading: false, error: null }; ///////////// case "loading": diff --git a/src/Redux/reducers/userProduct.js b/src/Redux/reducers/userProduct.js index c190b26..6edacb2 100644 --- a/src/Redux/reducers/userProduct.js +++ b/src/Redux/reducers/userProduct.js @@ -6,12 +6,22 @@ const initialState = { list: [], info: null, sum: null, + checkEmpty: false, }; export default function userProduct(state = initialState, action) { let { type, data, message } = action; switch (type) { case "userProduct/list": - return { ...state, loading: false, list: data, error: null }; + const checkEmpty = data.filter( + (item) => item.condition === 2 && item.product.productType === (1 || 3) + ); + return { + ...state, + loading: false, + list: data, + checkEmpty: checkEmpty.length > 0 ? false : true, + error: null, + }; case "userProduct/info": return { ...state, loading: false, info: data, error: null }; case "userProduct/update": diff --git a/src/assets/icons/image.jpg b/src/assets/icons/image.jpg new file mode 100644 index 0000000000000000000000000000000000000000..88109f8feaf30f9e89ff78153bf9e53bcf747001 GIT binary patch literal 12203 zcmeHtbySsGxA(KjO@|=e4U*EWbT>$+NQ#uwB?@dBHX+?99ZCoow4k(fgQQ4`)ZKud z<5A!7o-^Kizi)hZe0%Rdp0V~?bIoV2wSIH{=3HkV&Sn5?d1*Om00aU65bO(_jRO(@ z;^hYk2@woN27}R1QBY9PaL_SeUmRlWE7-6fF#*X{{Hr7cOq8UgluYalbPVhQ*RKo6 zNXi%*dY`=l(7+%o*cU_voV@|a&SfKl&L{c)L4<=x0HYuwgU-eP@Z}%la0+yaoOCgH zgfX2O=yDc?k7+A4U*qaBoBIE*G2~htN6XJW&l}&w%O{#iX4UZEY3F4@1_#yjk{~P^ zYEm{fT*2#Fqh><*_ishC8phL9=-mFJ0p~+;<(vD=>lI{>hHElrrQP2f%Ky^sFXOQP z)$AreD*uN{u(#u&t+Zd^>p-h%zD8i{bBk^GxZJSh(By00mW2koEL3M}l5BE%C`mD( zhyI3TEM=9P*8s+=5Ax@V8+wn3LZg4yl63QkymK-h;XYf_TDrWpS1>7$uD*RH)YM-2;CAp$1qQ9iQ>nW8&$zaPYN8Q9DiU<$s@$o72GJE#M(|NS=V+-G`n1_{KdwZ z-Gt*HMW09QY^k2TK6Y1oHPBJ6rQRRf3_4WS-e(c`V^Mpbkgdh`odNiLr2;N%Q_edk zwJVlTuDBXZXK2OXsAJD%+@yR zcJq6;8Oo+ZE8lUJCbL~E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/onInput.js b/src/util/onInput.js new file mode 100644 index 0000000..a42c2f8 --- /dev/null +++ b/src/util/onInput.js @@ -0,0 +1,274 @@ +import { toast } from "react-toastify"; + +class onInput { + persianOnly = (txt) => { + let newText = txt; + newText = newText.replace(/`/g, ""); + newText = newText.replace(/0/g, ""); + newText = newText.replace(/1/g, ""); + newText = newText.replace(/2/g, ""); + newText = newText.replace(/3/g, ""); + newText = newText.replace(/4/g, ""); + newText = newText.replace(/5/g, ""); + newText = newText.replace(/6/g, ""); + newText = newText.replace(/7/g, ""); + newText = newText.replace(/8/g, ""); + newText = newText.replace(/9/g, ""); + newText = newText.replace(/0/g, ""); + newText = newText.replace(/q/g, ""); + newText = newText.replace(/w/g, ""); + newText = newText.replace(/e/g, ""); + newText = newText.replace(/r/g, ""); + newText = newText.replace(/t/g, ""); + newText = newText.replace(/y/g, ""); + newText = newText.replace(/u/g, ""); + newText = newText.replace(/i/g, ""); + newText = newText.replace(/o/g, ""); + newText = newText.replace(/p/g, ""); + newText = newText.replace(/\[/g, ""); + newText = newText.replace(/\]/g, ""); + newText = newText.replace(/a/g, ""); + newText = newText.replace(/s/g, ""); + newText = newText.replace(/d/g, ""); + newText = newText.replace(/f/g, ""); + newText = newText.replace(/g/g, ""); + newText = newText.replace(/h/g, ""); + newText = newText.replace(/j/g, ""); + newText = newText.replace(/k/g, ""); + newText = newText.replace(/l/g, ""); + newText = newText.replace(/\;/g, ""); + newText = newText.replace(/\'/g, ""); + newText = newText.replace(/z/g, ""); + newText = newText.replace(/x/g, ""); + newText = newText.replace(/c/g, ""); + newText = newText.replace(/v/g, ""); + newText = newText.replace(/b/g, ""); + newText = newText.replace(/n/g, ""); + newText = newText.replace(/m/g, ""); + newText = newText.replace(/\,/g, ""); + newText = newText.replace(/\./g, ""); + newText = newText.replace(/\//g, ""); + newText = newText.replace(/~/g, " "); + newText = newText.replace(/Q/g, ""); + newText = newText.replace(/W/g, ""); + newText = newText.replace(/E/g, ""); + newText = newText.replace(/R/g, ""); + newText = newText.replace(/T/g, ""); + newText = newText.replace(/Y/g, ""); + newText = newText.replace(/U/g, ""); + newText = newText.replace(/I/g, ""); + newText = newText.replace(/O/g, ""); + newText = newText.replace(/P/g, ""); + newText = newText.replace(/A/g, ""); + newText = newText.replace(/S/g, ""); + newText = newText.replace(/G/g, ""); + newText = newText.replace(/H/g, ""); + newText = newText.replace(/J/g, ""); + newText = newText.replace(/K/g, ""); + newText = newText.replace(/L/g, ""); + newText = newText.replace(/Z/g, ""); + newText = newText.replace(/X/g, ""); + newText = newText.replace(/B/g, ""); + newText = newText.replace(/N/g, ""); + newText = newText.replace(/M/g, ""); + newText = newText.replace(/\?/g, ""); + if (!newText) { + toast.info("از کاراکتر فارسی استفاده کنید"); + } + return newText; + }; + englishAndNumberWithoutSpace = (txt) => { + let newText = txt; + newText = newText.replace(/`/g, ""); + newText = newText.replace(/0/g, "0"); + newText = newText.replace(/1/g, "1"); + newText = newText.replace(/2/g, "2"); + newText = newText.replace(/3/g, "3"); + newText = newText.replace(/4/g, "4"); + newText = newText.replace(/5/g, "5"); + newText = newText.replace(/6/g, "6"); + newText = newText.replace(/7/g, "7"); + newText = newText.replace(/8/g, "8"); + newText = newText.replace(/9/g, "9"); + newText = newText.replace(/ا/g, ""); + newText = newText.replace(/ب/g, ""); + newText = newText.replace(/پ/g, ""); + newText = newText.replace(/ت/g, ""); + newText = newText.replace(/ث/g, ""); + newText = newText.replace(/ج/g, ""); + newText = newText.replace(/چ/g, ""); + newText = newText.replace(/ح/g, ""); + newText = newText.replace(/خ/g, ""); + newText = newText.replace(/د/g, ""); + newText = newText.replace(/\[/g, ""); + newText = newText.replace(/\]/g, ""); + newText = newText.replace(/ذ/g, ""); + newText = newText.replace(/ر/g, ""); + newText = newText.replace(/ز/g, ""); + newText = newText.replace(/ژ/g, ""); + newText = newText.replace(/ط/g, ""); + newText = newText.replace(/ظ/g, ""); + newText = newText.replace(/ع/g, ""); + newText = newText.replace(/غ/g, ""); + newText = newText.replace(/ف/g, ""); + newText = newText.replace(/\;/g, ""); + newText = newText.replace(/\'/g, ""); + newText = newText.replace(/ق/g, ""); + newText = newText.replace(/س/g, ""); + newText = newText.replace(/ش/g, ""); + newText = newText.replace(/ص/g, ""); + newText = newText.replace(/ض/g, ""); + newText = newText.replace(/ک/g, ""); + newText = newText.replace(/گ/g, ""); + newText = newText.replace(/\,/g, ""); + newText = newText.replace(/\./g, ""); + newText = newText.replace(/\//g, ""); + newText = newText.replace(/~/g, " "); + newText = newText.replace(/ل/g, ""); + newText = newText.replace(/م/g, ""); + newText = newText.replace(/ن/g, ""); + newText = newText.replace(/و/g, ""); + newText = newText.replace(/ه/g, ""); + newText = newText.replace(/ی/g, ""); + newText = newText.replace(/\?/g, ""); + if (!newText) { + toast.info("از کاراکتر انگلیسی واعداداستفاده کنید"); + } + return newText; + }; + numberOnly = (txt) => { + let newText = txt; + newText = newText.replace(/`/g, ""); + newText = newText.replace(/0/g, "0"); + newText = newText.replace(/1/g, "1"); + newText = newText.replace(/2/g, "2"); + newText = newText.replace(/3/g, "3"); + newText = newText.replace(/4/g, "4"); + newText = newText.replace(/5/g, "5"); + newText = newText.replace(/6/g, "6"); + newText = newText.replace(/7/g, "7"); + newText = newText.replace(/8/g, "8"); + newText = newText.replace(/9/g, "9"); + newText = newText.replace(/ا/g, ""); + newText = newText.replace(/ب/g, ""); + newText = newText.replace(/پ/g, ""); + newText = newText.replace(/ت/g, ""); + newText = newText.replace(/ث/g, ""); + newText = newText.replace(/ج/g, ""); + newText = newText.replace(/چ/g, ""); + newText = newText.replace(/ح/g, ""); + newText = newText.replace(/خ/g, ""); + newText = newText.replace(/د/g, ""); + newText = newText.replace(/\[/g, ""); + newText = newText.replace(/\]/g, ""); + newText = newText.replace(/ذ/g, ""); + newText = newText.replace(/ر/g, ""); + newText = newText.replace(/ز/g, ""); + newText = newText.replace(/ژ/g, ""); + newText = newText.replace(/ط/g, ""); + newText = newText.replace(/ظ/g, ""); + newText = newText.replace(/ع/g, ""); + newText = newText.replace(/غ/g, ""); + newText = newText.replace(/ف/g, ""); + newText = newText.replace(/\;/g, ""); + newText = newText.replace(/\'/g, ""); + newText = newText.replace(/ق/g, ""); + newText = newText.replace(/س/g, ""); + newText = newText.replace(/ش/g, ""); + newText = newText.replace(/ص/g, ""); + newText = newText.replace(/ض/g, ""); + newText = newText.replace(/ک/g, ""); + newText = newText.replace(/گ/g, ""); + newText = newText.replace(/\,/g, ""); + newText = newText.replace(/\./g, ""); + newText = newText.replace(/\//g, ""); + newText = newText.replace(/~/g, " "); + newText = newText.replace(/ل/g, ""); + newText = newText.replace(/م/g, ""); + newText = newText.replace(/ن/g, ""); + newText = newText.replace(/و/g, ""); + newText = newText.replace(/ه/g, ""); + newText = newText.replace(/ی/g, ""); + newText = newText.replace(/\?/g, ""); + newText = newText.replace(/q/g, ""); + newText = newText.replace(/w/g, ""); + newText = newText.replace(/e/g, ""); + newText = newText.replace(/r/g, ""); + newText = newText.replace(/t/g, ""); + newText = newText.replace(/y/g, ""); + newText = newText.replace(/u/g, ""); + newText = newText.replace(/i/g, ""); + newText = newText.replace(/o/g, ""); + newText = newText.replace(/p/g, ""); + newText = newText.replace(/a/g, ""); + newText = newText.replace(/s/g, ""); + newText = newText.replace(/d/g, ""); + newText = newText.replace(/f/g, ""); + newText = newText.replace(/g/g, ""); + newText = newText.replace(/h/g, ""); + newText = newText.replace(/j/g, ""); + newText = newText.replace(/k/g, ""); + newText = newText.replace(/l/g, ""); + newText = newText.replace(/z/g, ""); + newText = newText.replace(/x/g, ""); + newText = newText.replace(/c/g, ""); + newText = newText.replace(/v/g, ""); + newText = newText.replace(/b/g, ""); + newText = newText.replace(/n/g, ""); + newText = newText.replace(/m/g, ""); + newText = newText.replace(/Q/g, ""); + newText = newText.replace(/W/g, ""); + newText = newText.replace(/E/g, ""); + newText = newText.replace(/R/g, ""); + newText = newText.replace(/T/g, ""); + newText = newText.replace(/Y/g, ""); + newText = newText.replace(/U/g, ""); + newText = newText.replace(/I/g, ""); + newText = newText.replace(/O/g, ""); + newText = newText.replace(/P/g, ""); + newText = newText.replace(/A/g, ""); + newText = newText.replace(/S/g, ""); + newText = newText.replace(/G/g, ""); + newText = newText.replace(/H/g, ""); + newText = newText.replace(/J/g, ""); + newText = newText.replace(/K/g, ""); + newText = newText.replace(/L/g, ""); + newText = newText.replace(/Z/g, ""); + newText = newText.replace(/X/g, ""); + newText = newText.replace(/B/g, ""); + newText = newText.replace(/N/g, ""); + newText = newText.replace(/M/g, ""); + if (!newText) { + toast.info("از اعداداستفاده کنید"); + } + return newText; + }; + dayHandler = (num) => { + let newNum = this.numberOnly(num); + if (newNum > 31) { + toast.error("روز نباید بزرگتر از 31 باشد."); + return Math.floor(newNum / 10); + } + return newNum; + }; + monthHandler = (num) => { + let newNum = this.numberOnly(num); + if (newNum > 12 || newNum < 0) { + toast.error("ماه باید بین 1 تا 12 باشد."); + return Math.floor(newNum / 10); + } + return newNum; + }; + yearHandler = (num) => { + let newNum = this.numberOnly(num); + if (newNum > 1395) { + toast.error("سال باید کوچک‌تر از 1395 باشد."); + return Math.floor(newNum / 10); + } + return newNum; + }; +} + +const _onInput = new onInput(); + +export default _onInput; diff --git a/src/views/AR/BreadCrumb/index.js b/src/views/AR/BreadCrumb/index.js new file mode 100644 index 0000000..b49bc8b --- /dev/null +++ b/src/views/AR/BreadCrumb/index.js @@ -0,0 +1,45 @@ +import React from "react"; +import Breadcrumbs from "@material-ui/core/Breadcrumbs"; +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, + mobile: window.innerWidth > maxDesktopSize ? 14 : window.innerWidth / 25, +}; + +export default function ActiveLastBreadcrumb(props) { + const { name } = props; + return ( + + 1000 ? fontSize.desktop : fontSize.mobile, + }} + to={"/"} + > + صفحه اصلی + + 1000 ? fontSize.desktop : fontSize.mobile, + color: "#00CC69", + }} + to={"/ar"} + > + واقعیت افزوده + + + ); +} diff --git a/src/views/AR/BreadCrumb/index.scss b/src/views/AR/BreadCrumb/index.scss new file mode 100644 index 0000000..e10f243 --- /dev/null +++ b/src/views/AR/BreadCrumb/index.scss @@ -0,0 +1,8 @@ +.MuiBreadcrumbs-li{ + a { + text-decoration: none; + font-family: numeralLight; + color: #6F7074; + letter-spacing: -1px; + } +} diff --git a/src/views/AR/index.js b/src/views/AR/index.js index 8a88bfc..b952c4a 100644 --- a/src/views/AR/index.js +++ b/src/views/AR/index.js @@ -6,6 +6,7 @@ import Navbar from "../Home/Navbar/index"; import Footer from "../Home/Footer/index"; import Loader from "~/components/Loader/index"; import Item from "./Item/index"; +import BreadCrumbs from "./BreadCrumb/index"; import "./index.scss"; @@ -30,8 +31,9 @@ class AR extends Component { {window.innerWidth > 1000 ? ( arList ? ( <> -
+
+