remove warnings

master
amir hosein gorji 3 years ago
parent fe5f0c818c
commit d542c25603
  1. 4
      public/offline.html
  2. 1
      src/App.css
  3. 3
      src/AppRouter.js
  4. 14
      src/Redux/actions/comment.js
  5. 7
      src/Redux/proxy.js
  6. 4
      src/Redux/reducers/book.js
  7. 1
      src/Redux/reducers/comment.js
  8. 2
      src/Redux/reducers/public.js
  9. 2
      src/Redux/reducers/userFactor.js
  10. 2
      src/Redux/reducers/userProduct.js
  11. 1
      src/util/onInput.js
  12. 7
      src/views/AR/BreadCrumb/index.js
  13. 2
      src/views/AR/index.js
  14. 4
      src/views/Activation/index.js
  15. 2
      src/views/Auth/Login/Code/index.js
  16. 2
      src/views/Auth/Profile/Document/index.js
  17. 3
      src/views/Auth/Profile/Input/index.js
  18. 2
      src/views/Auth/Profile/MultipleSelector/index.js
  19. 5
      src/views/Auth/Profile/Select/index.js
  20. 1
      src/views/Auth/Profile/TextArea/index.js
  21. 11
      src/views/Auth/Profile/Upload/index.js
  22. 21
      src/views/Auth/Profile/index.js
  23. 20
      src/views/Auth/Splash/ProgressBar/index.js
  24. 6
      src/views/Blog/BreadCrumb/index.js
  25. 12
      src/views/Blog/index.js
  26. 13
      src/views/Blog/index.scss
  27. 6
      src/views/Blogs/BreadCrumb/index.js
  28. 3
      src/views/Cart/DeliveryMethod/index.js
  29. 10
      src/views/Cart/Factor/index.js
  30. 4
      src/views/Cart/Table/index.js
  31. 11
      src/views/Cart/index.js
  32. 16
      src/views/ChatList/Search/index.js
  33. 67
      src/views/ChatList/index.js
  34. 101
      src/views/ChatRoom/Body/Input/index.js
  35. 18
      src/views/ChatRoom/Body/Keyboard/index.js
  36. 18
      src/views/ChatRoom/Body/Message/Inline/index.js
  37. 31
      src/views/ChatRoom/Body/Message/MultiSelect/index.js
  38. 26
      src/views/ChatRoom/Body/Message/Normal/index.js
  39. 23
      src/views/ChatRoom/Body/Message/Select/index.js
  40. 19
      src/views/ChatRoom/Body/Message/Slider/index.js
  41. 25
      src/views/ChatRoom/Body/Message/Sort/index.js
  42. 13
      src/views/ChatRoom/Body/Message/Tap/index.js
  43. 37
      src/views/ChatRoom/Body/Message/index.js
  44. 12
      src/views/ChatRoom/Body/index.js
  45. 2
      src/views/ChatRoom/Header/index.js
  46. 313
      src/views/ChatRoom/Info/index.js
  47. 13
      src/views/Contact/Input/index.js
  48. 1
      src/views/Contact/Select/index.js
  49. 7
      src/views/Download/BreadCrumb/index.js
  50. 7
      src/views/Download/index.js
  51. 3
      src/views/Faq/index.js
  52. 36
      src/views/Home/HomeScroll/index.js
  53. 3
      src/views/Home/HomeSearch/Select/index.js
  54. 2
      src/views/Home/HomeSearch/index.js
  55. 19
      src/views/Home/HomeSlider/Blog/index.js
  56. 2
      src/views/Home/HomeSlider/Simple/index.js
  57. 2
      src/views/Home/HomeStatic/Simple/index.js
  58. 2
      src/views/Home/HomeStatic/index.js
  59. 7
      src/views/Home/Navbar/Laptop/index.js
  60. 54
      src/views/Home/Navbar/Mobile/NavbarDrawer/NavbarDrawer.js
  61. 16
      src/views/Home/Navbar/Mobile/index.js
  62. 2
      src/views/Home/SingleBlog/index.js
  63. 6
      src/views/Home/index.js
  64. 7
      src/views/MyBooks/BreadCrumb/index.js
  65. 2
      src/views/MyBooks/index.js
  66. 12
      src/views/NewProfile/index.js
  67. 6
      src/views/Product/AddToCart/index.js
  68. 6
      src/views/Product/BreadCrumb/index.js
  69. 3
      src/views/Product/Comment/Reply/index.js
  70. 4
      src/views/Product/Gallery/index.js
  71. 25
      src/views/Product/Info/index.js
  72. 20
      src/views/Product/MaterialModal/index.js
  73. 6
      src/views/Product/index.js
  74. 6
      src/views/Products/BreadCrumb/index.js
  75. 2
      src/views/Products/Filters/AppliedFilters/index.js
  76. 9
      src/views/Products/Filters/TypicalFilters/index.js
  77. 4
      src/views/Products/List/index.js
  78. 2
      src/views/Products/Product/index.js
  79. 2
      src/views/Products/Select/index.js
  80. 9
      src/views/Products/index.js
  81. 3
      src/views/QR/BookContent/index.js
  82. 4
      src/views/QR/Image/Modal/index.js
  83. 17
      src/views/QR/Image/index.js
  84. 1
      src/views/QR/Links/index.js
  85. 14
      src/views/QR/SubjectsDropdown/index.js
  86. 2
      src/views/QR/VideoBox/React-video-js-player/index.js
  87. 1
      src/views/QR/VideoBox/index.js
  88. 5
      src/views/QR/index.js
  89. 2
      src/views/QRScan/LastQr/index.js
  90. 1
      src/views/QRScan/index.js
  91. 85
      src/views/Support/Upload/index.js
  92. 29
      src/views/Support/Upload/index.scss
  93. 103
      src/views/Support/index.js
  94. 278
      src/views/Support/index.scss

File diff suppressed because one or more lines are too long

@ -5,6 +5,7 @@
} }
#root { #root {
height: 100vh; height: 100vh;
max-width: 100vw !important;
} }
@font-face { @font-face {
font-family: numeralMedium; font-family: numeralMedium;

@ -27,7 +27,6 @@ import MyBooks from "./views/MyBooks/index";
import AR from "./views/AR/index"; import AR from "./views/AR/index";
import Download from "./views/Download/index"; import Download from "./views/Download/index";
import Support from "./views/Support/index"; import Support from "./views/Support/index";
import Callback from "./views/Callback/index";
import NewProfile from "./views/NewProfile/index"; import NewProfile from "./views/NewProfile/index";
import Blogs from "./views/Blogs/index"; import Blogs from "./views/Blogs/index";
import Blog from "./views/Blog/index"; import Blog from "./views/Blog/index";
@ -71,7 +70,7 @@ class AppRouter extends Component {
console.log({ status, s: this.props.profile }); console.log({ status, s: this.props.profile });
let home = ( let home = (
<Route exact path={"/"}> <Route exact path={"/"}>
{status && status.status == 0 ? ( {status && status.status === 0 ? (
<Auth page={"profile"} /> <Auth page={"profile"} />
) : ( ) : (
<Home status={status} /> <Home status={status} />

@ -10,18 +10,10 @@ const comment = {
await proxy.get("comment/info", data, { dispatch }); await proxy.get("comment/info", data, { dispatch });
}, },
add: add:
( (data = {}, data2) =>
data = {},
data2 = {
id: window.location.pathname.slice(
window.location.pathname.lastIndexOf("/") + 1,
window.location.pathname.length
),
}
) =>
async (dispatch) => { async (dispatch) => {
await proxy.post("comment/add", data); await proxy.post("comment/add", data, { dispatch });
await proxy.get("book/info", data2, { dispatch }); if (data2) await proxy.get("book/info", data2, { dispatch });
}, },
del: del:
(data = {}, data2 = {}) => (data = {}, data2 = {}) =>

@ -2,7 +2,6 @@ import { ApiConfig } from "./../constants/defaultValues";
import axios from "axios"; import axios from "axios";
let { baseUrl } = ApiConfig; let { baseUrl } = ApiConfig;
let access = window.localStorage.getItem("access");
window.baseURL = baseUrl; window.baseURL = baseUrl;
baseUrl = baseUrl + "/"; baseUrl = baseUrl + "/";
@ -45,7 +44,7 @@ class Proxy {
check = async (url, { dispatch }, fetch, params) => { check = async (url, { dispatch }, fetch, params) => {
dispatch = dispatch || (() => {}); dispatch = dispatch || (() => {});
dispatch({ type: url.split("/")[0] + "/" + "loading" }); dispatch({ type: `${url.split("/")[0]}/loading` });
let response = await fetch(); let response = await fetch();
switch (response.status) { switch (response.status) {
case 200: case 200:
@ -60,7 +59,7 @@ class Proxy {
break; break;
default: default:
dispatch({ dispatch({
type: url.split("/")[0] + "/" + "error", type: `${url.split("/")[0]}/error`,
data: response.data, data: response.data,
params, params,
}); });
@ -106,7 +105,7 @@ class Proxy {
let refresh = localStorage.getItem("refresh"); let refresh = localStorage.getItem("refresh");
let userData = localStorage.getItem("userData"); let userData = localStorage.getItem("userData");
if (!refresh) return false; if (!refresh) return false;
if (refresh == "undefined") { if (refresh === "undefined") {
localStorage.removeItem("refresh"); localStorage.removeItem("refresh");
localStorage.removeItem("access"); localStorage.removeItem("access");
localStorage.removeItem("userData"); localStorage.removeItem("userData");

@ -75,7 +75,7 @@ export default function book(state = initialState, action) {
let finalSort; let finalSort;
let byLevelFilter = []; let byLevelFilter = [];
if (level.length > 0) { if (level.length > 0) {
level.map((item1) => { level.forEach((item1) => {
for (let i = 0; i < realList.length; i++) { for (let i = 0; i < realList.length; i++) {
if (grades[realList[i].gradeId] === item1) { if (grades[realList[i].gradeId] === item1) {
byLevelFilter.push(realList[i]); byLevelFilter.push(realList[i]);
@ -88,7 +88,7 @@ export default function book(state = initialState, action) {
let bySubjectFilter = []; let bySubjectFilter = [];
if (subject.length > 0) { if (subject.length > 0) {
subject.map((item1) => { subject.forEach((item1) => {
for (let i = 0; i < byLevelFilter.length; i++) { for (let i = 0; i < byLevelFilter.length; i++) {
if (byLevelFilter[i].name === item1) { if (byLevelFilter[i].name === item1) {
bySubjectFilter.push(byLevelFilter[i]); bySubjectFilter.push(byLevelFilter[i]);

@ -14,6 +14,7 @@ export default function comment(state = initialState, action) {
case "comment/update": case "comment/update":
return { ...state, loading: false, error: null }; return { ...state, loading: false, error: null };
case "comment/add": case "comment/add":
toast.success("ثبت درخواست با موفقیت انجام شد");
return { ...state, loading: false, error: null }; return { ...state, loading: false, error: null };
case "comment/delete": case "comment/delete":
return { ...state, loading: false, error: null }; return { ...state, loading: false, error: null };

@ -92,7 +92,7 @@ export default function publicApi(state = initialState, action) {
} }
let byLevelFilter = []; let byLevelFilter = [];
if (level.length > 0) { if (level.length > 0) {
level.map((item1) => { level.forEach((item1) => {
for (let i = 0; i < realList.length; i++) { for (let i = 0; i < realList.length; i++) {
if (grades[realList[i].book.gradeId] === item1) { if (grades[realList[i].book.gradeId] === item1) {
byLevelFilter.push(realList[i]); byLevelFilter.push(realList[i]);

@ -10,7 +10,7 @@ const initialState = {
isVerified: null, isVerified: null,
}; };
export default function userFactor(state = initialState, action) { export default function userFactor(state = initialState, action) {
let { type, data, message } = action; let { type, data } = action;
switch (type) { switch (type) {
case "userFactor/list": case "userFactor/list":
const checkEmpty = data.filter( const checkEmpty = data.filter(

@ -11,7 +11,7 @@ const initialState = {
myList: [], myList: [],
}; };
export default function userProduct(state = initialState, action) { export default function userProduct(state = initialState, action) {
let { type, data, message } = action; let { type, data } = action;
switch (type) { switch (type) {
case "userProduct/list": case "userProduct/list":
const checkEmpty = data.filter( const checkEmpty = data.filter(

@ -1,3 +1,4 @@
/* eslint-disable no-useless-escape */
import { toast } from "react-toastify"; import { toast } from "react-toastify";
class onInput { class onInput {

@ -4,13 +4,7 @@ import { Link } from "react-router-dom";
import "./index.scss"; import "./index.scss";
function handleClick(event) {
event.preventDefault();
console.info("You clicked a breadcrumb.");
}
const maxDesktopSize = 1250; const maxDesktopSize = 1250;
const maxMobileSize = 650;
const fontSize = { const fontSize = {
desktop: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 90, desktop: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 90,
@ -18,7 +12,6 @@ const fontSize = {
}; };
export default function ActiveLastBreadcrumb(props) { export default function ActiveLastBreadcrumb(props) {
const { name } = props;
return ( return (
<Breadcrumbs aria-label="breadcrumb"> <Breadcrumbs aria-label="breadcrumb">
<Link <Link

@ -96,7 +96,7 @@ class AR extends Component {
export default connect( export default connect(
(state) => ({ (state) => ({
arList: (state.userProduct.myList || []).filter( arList: (state.userProduct.myList || []).filter(
(product) => product.productType == 3 (product) => product.productType === 3
), ),
loading: state.loading, loading: state.loading,
}), }),

@ -6,8 +6,7 @@ import Footer from "../Home/Footer/index";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import analytics from "../../assets/icons/analytics.svg"; 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 qrcode from "~/assets/icons/drawer-qr.png";
import "./index.scss"; import "./index.scss";
@ -38,7 +37,6 @@ class Activation extends Component {
submitAdd() {} submitAdd() {}
render() { render() {
const { data } = this.props;
return ( return (
<> <>
{window.innerWidth > 1000 ? ( {window.innerWidth > 1000 ? (

@ -1,9 +1,7 @@
import React, { Component } from "react"; import React, { Component } from "react";
import { Link } from "react-router-dom";
import Timer from "../Timer/index"; import Timer from "../Timer/index";
import logo from "../../../../assets/icons/logo.png"; import logo from "../../../../assets/icons/logo.png";
import pic from "../../../../assets/images/pic.png";
import "./index.scss"; import "./index.scss";

@ -1,6 +1,4 @@
import React from "react"; import React from "react";
import AddAPhotoIcon from "@material-ui/icons/AddAPhoto";
import "./index.scss"; import "./index.scss";
const maxDesktopSize = 1250; const maxDesktopSize = 1250;

@ -19,8 +19,7 @@ export default function FormPropsTextFields(props) {
})); }));
const classes = useStyles(); const classes = useStyles();
const { parent, defaultValue, maxLength, inputMode, onInput, variant } = const { parent, defaultValue, maxLength, onInput, variant } = props;
props;
return ( return (
<form className={classes.root} noValidate autoComplete="off"> <form className={classes.root} noValidate autoComplete="off">
<div> <div>

@ -24,7 +24,7 @@ export default function MultipleSelector(props) {
})); }));
const classes = useStyles(); const classes = useStyles();
const { parent, defaultValue, name, label, options, selectedOptions } = props; const { parent, name, label, options, selectedOptions } = props;
return ( return (
<> <>
{window.innerWidth < 1000 ? ( {window.innerWidth < 1000 ? (

@ -1,13 +1,10 @@
import React from "react"; 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 FormControl from "@material-ui/core/FormControl";
import Select from "@material-ui/core/Select"; import Select from "@material-ui/core/Select";
import InputBase from "@material-ui/core/InputBase";
import KeyboardArrowDownIcon from "@material-ui/icons/KeyboardArrowDown"; import KeyboardArrowDownIcon from "@material-ui/icons/KeyboardArrowDown";
import InputLabel from "@material-ui/core/InputLabel"; import InputLabel from "@material-ui/core/InputLabel";
const BootstrapInput = withStyles((theme) => ({}))(InputBase);
const useStyles = makeStyles((theme) => ({ const useStyles = makeStyles((theme) => ({
marginLeft: { marginLeft: {
// margin: theme.spacing(1), // margin: theme.spacing(1),

@ -13,7 +13,6 @@ const useStyles = makeStyles((theme) => ({
export default function MultilineTextFields(props) { export default function MultilineTextFields(props) {
const classes = useStyles(); const classes = useStyles();
const [value, setValue] = React.useState("Controlled");
const { parent, defaultValue } = props; const { parent, defaultValue } = props;
return ( return (
<form className={classes.root} noValidate autoComplete="off"> <form className={classes.root} noValidate autoComplete="off">

@ -1,17 +1,8 @@
import React from "react"; import React from "react";
import AddAPhotoIcon from "@material-ui/icons/AddAPhoto"; 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) { export default function Upload(props) {
let { parent, name } = props; let { parent } = props;
return ( return (
<> <>
{window.innerWidth < 1000 ? ( {window.innerWidth < 1000 ? (

@ -12,7 +12,6 @@ import Birthdate from "./Birthdate/index";
import MultipleSelector from "./MultipleSelector/index"; import MultipleSelector from "./MultipleSelector/index";
import Loader from "~/components/Loader/index"; import Loader from "~/components/Loader/index";
import Document from "./Document/index"; import Document from "./Document/index";
import logo from "../../../assets/icons/logo.png";
import pic from "../../../assets/images/pic.png"; import pic from "../../../assets/images/pic.png";
import "./index.scss"; import "./index.scss";
import { useHistory } from "react-router-dom"; import { useHistory } from "react-router-dom";
@ -36,12 +35,6 @@ const fontSize = {
}, },
}; };
const toastMessages = {
firstName: "نام وارد شده صحیح نیست!",
lastName: "نام خانوادگی وارد شده صحیح نیست!",
username: "نام کاربری صحیح نیست.",
};
class Profile extends Component { class Profile extends Component {
state = { state = {
render: false, render: false,
@ -341,7 +334,7 @@ class Profile extends Component {
label={"شهر/روستا"} label={"شهر/روستا"}
/> />
</div> */} </div> */}
{this.state.status == 1 ? ( {this.state.status === 1 ? (
<div className="mb-2"> <div className="mb-2">
<Input <Input
parent={this} parent={this}
@ -352,7 +345,7 @@ class Profile extends Component {
/> />
</div> </div>
) : null} ) : null}
{this.state.status == 2 ? ( {this.state.status === 2 ? (
<div className="mb-2"> <div className="mb-2">
<Input <Input
parent={this} parent={this}
@ -363,7 +356,7 @@ class Profile extends Component {
/> />
</div> </div>
) : null} ) : null}
{this.state.status == 2 ? ( {this.state.status === 2 ? (
<Document parent={this} name="docFileIds" /> <Document parent={this} name="docFileIds" />
) : null} ) : null}
<div className="mb-2"> <div className="mb-2">
@ -489,7 +482,7 @@ class Profile extends Component {
selectedOptions={this.state.gradeIds} selectedOptions={this.state.gradeIds}
/> />
) : null} ) : null}
{this.state.status == 1 && Number(this.state.gradeIds) > 9 ? ( {this.state.status === 1 && Number(this.state.gradeIds) > 9 ? (
<Select <Select
parent={this} parent={this}
options={[ options={[
@ -526,7 +519,7 @@ class Profile extends Component {
name="zoneId" name="zoneId"
label={"شهر/روستا"} label={"شهر/روستا"}
/> */} /> */}
{this.state.status == 1 ? ( {this.state.status === 1 ? (
<Input <Input
parent={this} parent={this}
name="schools" name="schools"
@ -535,7 +528,7 @@ class Profile extends Component {
onInput={onInput.persianOnly} onInput={onInput.persianOnly}
/> />
) : null} ) : null}
{this.state.status == 2 ? ( {this.state.status === 2 ? (
<Input <Input
parent={this} parent={this}
name="schools" name="schools"
@ -544,7 +537,7 @@ class Profile extends Component {
onInput={onInput.persianOnly} onInput={onInput.persianOnly}
/> />
) : null} ) : null}
{this.state.status == 2 ? ( {this.state.status === 2 ? (
<Document parent={this} name="docFileIds" /> <Document parent={this} name="docFileIds" />
) : null} ) : null}
<Input <Input

@ -1,4 +1,4 @@
import React, { useState, useEffect } from "react"; import React from "react";
import "./index.scss"; import "./index.scss";
export default class ProgressBar extends React.Component { export default class ProgressBar extends React.Component {
@ -26,20 +26,22 @@ export default class ProgressBar extends React.Component {
{window.innerWidth > 1000 ? ( {window.innerWidth > 1000 ? (
<div className="progresss d-flex"> <div className="progresss d-flex">
<div style={{ width: this.state.percent + "%" }}> <div style={{ width: this.state.percent + "%" }}>
{ {this.state.percent ? (
this.state.percent ? <span className="d-flex align-items-center justify-content-center">
<span className="d-flex align-items-center justify-content-center">{this.state.percent}%</span> : null {this.state.percent}%
} </span>
) : null}
</div> </div>
</div> </div>
) : null} ) : null}
{window.innerWidth < 1000 ? ( {window.innerWidth < 1000 ? (
<div className="mobile-progress d-flex"> <div className="mobile-progress d-flex">
<div style={{ width: this.state.percent + "%" }}> <div style={{ width: this.state.percent + "%" }}>
{ {this.state.percent ? (
this.state.percent ? <span className="d-flex align-items-center justify-content-center">
<span className="d-flex align-items-center justify-content-center">{this.state.percent}%</span> : null {this.state.percent}%
} </span>
) : null}
</div> </div>
</div> </div>
) : null} ) : null}

@ -4,13 +4,7 @@ import { Link } from "react-router-dom";
import "./index.scss"; import "./index.scss";
function handleClick(event) {
event.preventDefault();
console.info("You clicked a breadcrumb.");
}
const maxDesktopSize = 1250; const maxDesktopSize = 1250;
const maxMobileSize = 650;
const fontSize = { const fontSize = {
desktop: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 90, desktop: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 90,

@ -3,7 +3,6 @@ import Loader from "~/components/Loader/index";
import Footer from "../Home/Footer/index"; import Footer from "../Home/Footer/index";
import Navbar from "../Home/Navbar/index"; import Navbar from "../Home/Navbar/index";
import BreadCrumb from "./BreadCrumb/index"; import BreadCrumb from "./BreadCrumb/index";
import Image from "../QR/Image/index";
import VideoBox from "../QR/VideoBox/index"; import VideoBox from "../QR/VideoBox/index";
import VoiceBox from "../QR/VoiceBox/index"; import VoiceBox from "../QR/VoiceBox/index";
@ -55,7 +54,6 @@ class Blog extends Component {
<h1>{blog.title}</h1> <h1>{blog.title}</h1>
</div> </div>
<div className="landscape-blog__header--bottom d-flex"> <div className="landscape-blog__header--bottom d-flex">
<h2></h2>
<div>{blog.date}</div> <div>{blog.date}</div>
</div> </div>
</div> </div>
@ -64,7 +62,7 @@ class Blog extends Component {
<Identifier data={blog} fontSize={fontSize} /> <Identifier data={blog} fontSize={fontSize} />
</div> </div>
<p className="landscape-blog__body--text d-flex"> <p className="landscape-blog__body--text d-flex">
{blog.text} <div dangerouslySetInnerHTML={{ __html: blog.text }}></div>
</p> </p>
</div> </div>
</div> </div>
@ -98,7 +96,12 @@ class Blog extends Component {
<div className="portrait-blog__body--image d-flex"> <div className="portrait-blog__body--image d-flex">
<Identifier data={blog} /> <Identifier data={blog} />
</div> </div>
<p className="portrait-blog__body--text d-flex">{blog.text}</p> <p
className="portrait-blog__body--text "
style={{ padding: 10, maxWidth: "95% !important" }}
>
<div dangerouslySetInnerHTML={{ __html: blog.text }}></div>
</p>
</div> </div>
</div> </div>
) : ( ) : (
@ -134,6 +137,7 @@ const Identifier = (props) => {
) : null} ) : null}
{data.type === "image" ? ( {data.type === "image" ? (
<img <img
style={{ margin: "auto" }}
src={"https://dnvn.ir/api/v1/file/" + data.fileIds} src={"https://dnvn.ir/api/v1/file/" + data.fileIds}
alt={data.fileIds} alt={data.fileIds}
/> />

@ -1,5 +1,6 @@
.portrait-blog { .portrait-blog {
width: 100vw; max-width: 95vw !important;
// height: 100vh; // height: 100vh;
padding: 0px 10px; padding: 0px 10px;
position: relative; position: relative;
@ -45,6 +46,7 @@
&--image { &--image {
width: 100%; width: 100%;
& img { & img {
max-width: 80vw !important;
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 10px; border-radius: 10px;
@ -60,6 +62,12 @@
font-size: 14px; font-size: 14px;
letter-spacing: -1px; letter-spacing: -1px;
font-family: numeralLight; font-family: numeralLight;
& img {
max-width: 80vw !important;
height: 100%;
border-radius: 10px;
margin: 0 auto;
}
} }
} }
} }
@ -113,8 +121,9 @@
&__body { &__body {
width: 100%; width: 100%;
&--image { &--image {
margin: auto;
width: 100%; width: 100%;
max-height: 300px; // max-height: 300px;
} }
&--text { &--text {
margin-top: 40px; margin-top: 40px;

@ -4,13 +4,7 @@ import { Link } from "react-router-dom";
import "./index.scss"; import "./index.scss";
function handleClick(event) {
event.preventDefault();
console.info("You clicked a breadcrumb.");
}
const maxDesktopSize = 1250; const maxDesktopSize = 1250;
const maxMobileSize = 650;
const fontSize = { const fontSize = {
desktop: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 90, desktop: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 90,

@ -27,8 +27,7 @@ const fontSize = {
}; };
class DeliveryMethod extends Component { class DeliveryMethod extends Component {
render() { render() {
const { data, setTransport, factorInfo, parent, transportId, list } = const { data, setTransport, factorInfo, transportId } = this.props;
this.props;
return ( return (
<> <>
{window.innerWidth > 1000 ? ( {window.innerWidth > 1000 ? (

@ -1,4 +1,4 @@
import React, { Component } from "react"; import React from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import "./index.scss"; import "./index.scss";
@ -26,14 +26,6 @@ const fontSize = {
}; };
const Factor = (props) => { 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; const { factorInfo } = props;
return ( return (
<> <>

@ -75,7 +75,7 @@ const fontSize = {
function BasicTable(props) { function BasicTable(props) {
const classes = useStyles(); const classes = useStyles();
const { list, handleCounter, handleDelete, route, factorInfo } = props; const { list, handleDelete, route, factorInfo } = props;
const sum = () => { const sum = () => {
let total = 0; let total = 0;
for (let i = 0; i < list.length; i++) { for (let i = 0; i < list.length; i++) {
@ -181,7 +181,7 @@ function BasicTable(props) {
} }
const Item = (props) => { const Item = (props) => {
const { data, pushToCart, id, route, factorInfo } = props; const { data, pushToCart, id, route } = props;
return ( return (
<> <>
{window.innerWidth < 1000 ? ( {window.innerWidth < 1000 ? (

@ -11,8 +11,6 @@ import Factor from "./Factor/index";
import Loader from "~/components/Loader/index"; import Loader from "~/components/Loader/index";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import sciense_6 from "../../assets/images/sciense-6.png";
import "./index.scss"; import "./index.scss";
const maxDesktopSize = 1250; const maxDesktopSize = 1250;
@ -65,7 +63,7 @@ class Cart extends Component {
// if (this.props.list.length > 0) { // if (this.props.list.length > 0) {
// let wantedId; //should be zero // let wantedId; //should be zero
// for (let item of this.props.list) { // for (let item of this.props.list) {
// if (item.condition == 2) { // if (item.condition === 2) {
// wantedId = item.id; // wantedId = item.id;
// break; // break;
// } // }
@ -116,9 +114,8 @@ class Cart extends Component {
}; };
render() { render() {
const { list, payPrice, payMethods, factorInfo, userId, hasPhysical } = const { list, payPrice, payMethods, factorInfo, userId } = this.props;
this.props; if (!factorInfo || list.length === 0)
if (!factorInfo || list.length == 0)
return ( return (
<div <div
align="center" align="center"
@ -154,7 +151,7 @@ class Cart extends Component {
<div className="cart d-flex flex-column"> <div className="cart d-flex flex-column">
<Navbar /> <Navbar />
{window.location.search.includes("NOK") || {window.location.search.includes("NOK") ||
this.props.isVerified == false ? ( this.props.isVerified === false ? (
<div>پرداخت شما با خطا مواجه شد ، لطفا مجدد تلاش نمایید</div> <div>پرداخت شما با خطا مواجه شد ، لطفا مجدد تلاش نمایید</div>
) : null} ) : null}
<div <div

@ -1,7 +1,7 @@
import React, { Component } from 'react'; import React from "react";
import navbarSearch from "../../../assets/icons/navbarSearch.png"; import navbarSearch from "../../../assets/icons/navbarSearch.png";
import './index.scss'; import "./index.scss";
const maxDesktopSize = 1250; const maxDesktopSize = 1250;
@ -11,11 +11,15 @@ const fontSize = {
}, },
}; };
export default function Search(props){ export default function Search(props) {
return( return (
<div className="desktop-chat-search d-flex"> <div className="desktop-chat-search d-flex">
<input type="search" style={{ fontSize: fontSize.desktop.input }} placeholder="جستجو" /> <input
type="search"
style={{ fontSize: fontSize.desktop.input }}
placeholder="جستجو"
/>
<img src={navbarSearch} alt="جستجو" /> <img src={navbarSearch} alt="جستجو" />
</div> </div>
); );
} }

@ -1,30 +1,27 @@
import React, { Component } from 'react'; import React, { Component } from "react";
import {Link} from 'react-router-dom'; import { Link } from "react-router-dom";
import { chat } from '../../Redux/actions'; import { chat } from "../../Redux/actions";
import { connect } from 'react-redux'; import { connect } from "react-redux";
import ChatIcon from '@material-ui/icons/Chat'; import ChatIcon from "@material-ui/icons/Chat";
import Chat from './Chat/index'; import Chat from "./Chat/index";
import Navbar from '../Home/Navbar/index'; import Navbar from "../Home/Navbar/index";
import Search from './Search/index'; import Search from "./Search/index";
import Chatroom from '../ChatRoom/index'; import Chatroom from "../ChatRoom/index";
import './index.scss'; import "./index.scss";
import { DesktopWindowsRounded } from '@material-ui/icons';
class ChatList extends Component { class ChatList extends Component {
state = { state = {
selectedUser: null, selectedUser: null,
} };
componentDidMount() { componentDidMount() {
this.props.list(); this.props.list();
} }
render() { render() {
return ( return (
<> <>
{ {window.innerWidth < 1000 ? (
window.innerWidth < 1000 ?
<div className="chat-list d-flex flex-column"> <div className="chat-list d-flex flex-column">
<Navbar /> <Navbar />
{this.props.chat_list.map((item, i) => ( {this.props.chat_list.map((item, i) => (
@ -33,35 +30,38 @@ class ChatList extends Component {
<Link to="/characters" className="chat-list__float d-flex"> <Link to="/characters" className="chat-list__float d-flex">
<ChatIcon fontSize="small" /> <ChatIcon fontSize="small" />
</Link> </Link>
</div> : null </div>
} ) : null}
{ {window.innerWidth > 1000 ? (
window.innerWidth > 1000 ?
<div className="desktop-chat d-flex"> <div className="desktop-chat d-flex">
<div className="desktop-chat__banner"> <div className="desktop-chat__banner"></div>
</div>
<div className="desktop-chat__list d-flex flex-column"> <div className="desktop-chat__list d-flex flex-column">
<Search /> <Search />
{this.props.chat_list.map((item, i) => ( {this.props.chat_list.map((item, i) => (
<Chat selectedUser={this.state.selectedUser} key={i} data={item} parent={this} /> <Chat
selectedUser={this.state.selectedUser}
key={i}
data={item}
parent={this}
/>
))} ))}
<Link to="/characters" className="desktop-chat__list--float d-flex"> <Link
to="/characters"
className="desktop-chat__list--float d-flex"
>
<ChatIcon fontSize="small" /> <ChatIcon fontSize="small" />
</Link> </Link>
</div> </div>
{ {this.state.selectedUser ? (
this.state.selectedUser ? <Chatroom id={this.state.selectedUser} />
<Chatroom id={this.state.selectedUser} /> : ) : (
<div className="desktop-chat__before d-flex"> <div className="desktop-chat__before d-flex">
<h1>برای شروع روی یک چت کلیک کن</h1> <h1>برای شروع روی یک چت کلیک کن</h1>
</div> </div>
} )}
</div>
</div> : null ) : null}
}
</> </>
); );
} }
} }
@ -70,6 +70,5 @@ export default connect(
(state) => ({ (state) => ({
chat_list: state.chat.list || [], chat_list: state.chat.list || [],
}), }),
{ list : chat.list } { list: chat.list }
)(ChatList); )(ChatList);

@ -1,16 +1,16 @@
import React, { Component } from 'react'; import React, { Component } from "react";
import AudioReactRecorder from 'audio-react-recorder'; import AudioReactRecorder from "audio-react-recorder";
import MicIcon from '@material-ui/icons/Mic'; import MicIcon from "@material-ui/icons/Mic";
import CheckIcon from '@material-ui/icons/Check'; import CheckIcon from "@material-ui/icons/Check";
import CloseIcon from '@material-ui/icons/Close'; import CloseIcon from "@material-ui/icons/Close";
import AttachmentIcon from '@material-ui/icons/Attachment'; import AttachmentIcon from "@material-ui/icons/Attachment";
import TextField from '@material-ui/core/TextField'; import TextField from "@material-ui/core/TextField";
import SendIcon from '@material-ui/icons/Send'; import SendIcon from "@material-ui/icons/Send";
import EmojiEmotions from '@material-ui/icons/EmojiEmotions'; import EmojiEmotions from "@material-ui/icons/EmojiEmotions";
import KeyboardIcon from '@material-ui/icons/Keyboard'; import KeyboardIcon from "@material-ui/icons/Keyboard";
import PhotoCamera from '@material-ui/icons/PhotoCamera'; import PhotoCamera from "@material-ui/icons/PhotoCamera";
import './index.scss'; import "./index.scss";
export default class ChatInputs extends Component { export default class ChatInputs extends Component {
state = { state = {
emoji: false, emoji: false,
@ -24,7 +24,7 @@ export default class ChatInputs extends Component {
cancel, cancel,
typeText, typeText,
message, message,
sendMessage,
addFile, addFile,
file, file,
addcounter, addcounter,
@ -45,13 +45,16 @@ export default class ChatInputs extends Component {
<div className="chat-inputs__voice d-flex flex-row-reverse"> <div className="chat-inputs__voice d-flex flex-row-reverse">
<div className="chat-inputs__voice d-flex"> <div className="chat-inputs__voice d-flex">
{(recordState === null && message === '' && file === null) || {(recordState === null && message === "" && file === null) ||
(recordState && recordState.url && message === '' && file === null) ? ( (recordState &&
recordState.url &&
message === "" &&
file === null) ? (
<div className="chat-inputs__voice--icon d-flex" onClick={start}> <div className="chat-inputs__voice--icon d-flex" onClick={start}>
<MicIcon <MicIcon
style={{ style={{
color: 'white', color: "white",
backgroundColor: '#128c7e', backgroundColor: "#128c7e",
width: 50, width: 50,
height: 50, height: 50,
borderRadius: 30, borderRadius: 30,
@ -60,47 +63,63 @@ export default class ChatInputs extends Component {
/> />
</div> </div>
) : null} ) : null}
{message !== '' || file !== null ? ( {message !== "" || file !== null ? (
<div className="chat-inputs__voice--icon d-flex" onClick={() => addcounter()}> <div
className="chat-inputs__voice--icon d-flex"
onClick={() => addcounter()}
>
<SendIcon <SendIcon
style={{ style={{
padding: '12px 10px 12px 13px', padding: "12px 10px 12px 13px",
color: 'white', color: "white",
backgroundColor: '#128c7e', backgroundColor: "#128c7e",
width: 50, width: 50,
height: 50, height: 50,
borderRadius: 30, borderRadius: 30,
transform: 'rotate(180deg)', transform: "rotate(180deg)",
}} }}
/> />
</div> </div>
) : null} ) : null}
{recordState === 'start' ? ( {recordState === "start" ? (
<> <>
<div className="chat-inputs__voice--icon d-flex mr-2" onClick={cancel}> <div
className="chat-inputs__voice--icon d-flex mr-2"
onClick={cancel}
>
<CloseIcon <CloseIcon
style={{ color: 'red', backgroundColor: 'white', width: 30, height: 30 }} style={{
color: "red",
backgroundColor: "white",
width: 30,
height: 30,
}}
/> />
</div> </div>
<div className="chat-inputs__voice--icon d-flex" onClick={stop}> <div className="chat-inputs__voice--icon d-flex" onClick={stop}>
<CheckIcon <CheckIcon
style={{ color: 'green', backgroundColor: 'white', width: 30, height: 30 }} style={{
color: "green",
backgroundColor: "white",
width: 30,
height: 30,
}}
/> />
</div> </div>
</> </>
) : null} ) : null}
</div> </div>
</div> </div>
{recordState !== 'start' ? ( {recordState !== "start" ? (
<div className="chat-inputs__box d-flex flex-row-reverse"> <div className="chat-inputs__box d-flex flex-row-reverse">
{message === '' ? ( {message === "" ? (
<PhotoCamera <PhotoCamera
style={{ style={{
color: '#aaa', color: "#aaa",
marginRight: 0, marginRight: 0,
width: 25, width: 25,
height: 25, height: 25,
margin: '0 3px', margin: "0 3px",
}} }}
/> />
) : null} ) : null}
@ -109,15 +128,15 @@ export default class ChatInputs extends Component {
<AttachmentIcon <AttachmentIcon
style={{ style={{
color: '#aaa', color: "#aaa",
marginRight: 10, marginRight: 10,
width: 25, width: 25,
height: 25, height: 25,
zIndex: 10, zIndex: 10,
position: 'absolute', position: "absolute",
top: 0, top: 0,
left: 0, left: 0,
transform: 'rotate(45deg)', transform: "rotate(45deg)",
}} }}
/> />
</div> </div>
@ -128,7 +147,7 @@ export default class ChatInputs extends Component {
value={message} value={message}
placeholder="یک پیام بنویسید..." placeholder="یک پیام بنویسید..."
rowsMax={4} rowsMax={4}
onChange={(e) => typeText('text',e.target.value)} onChange={(e) => typeText("text", e.target.value)}
multiline multiline
style={{ style={{
marginRight: 5, marginRight: 5,
@ -137,28 +156,28 @@ export default class ChatInputs extends Component {
{this.props.parent.state.emoji ? ( {this.props.parent.state.emoji ? (
<KeyboardIcon <KeyboardIcon
style={{ style={{
color: '#aaa', color: "#aaa",
marginRight: -5, marginRight: -5,
width: 25, width: 25,
height: 25, height: 25,
zIndex: 10, zIndex: 10,
position: 'relative', position: "relative",
bottom: 5, bottom: 5,
alignSelf: 'flex-end', alignSelf: "flex-end",
}} }}
onClick={() => this.props.parent.setState({ emoji: false })} onClick={() => this.props.parent.setState({ emoji: false })}
/> />
) : ( ) : (
<EmojiEmotions <EmojiEmotions
style={{ style={{
color: '#aaa', color: "#aaa",
marginRight: -5, marginRight: -5,
width: 25, width: 25,
height: 25, height: 25,
zIndex: 10, zIndex: 10,
position: 'relative', position: "relative",
bottom: 5, bottom: 5,
alignSelf: 'flex-end', alignSelf: "flex-end",
}} }}
onClick={() => this.props.parent.setState({ emoji: true })} onClick={() => this.props.parent.setState({ emoji: true })}
/> />

@ -1,10 +1,15 @@
import React, { Component } from 'react'; import React from "react";
import Carousel from 'react-elastic-carousel'; import Carousel from "react-elastic-carousel";
import './index.scss'; import "./index.scss";
export default function Keyboard({ options, action }) { export default function Keyboard({ options, action }) {
return ( return (
<div className="chat-suggest portrait-slider d-flex flex-column"> <div className="chat-suggest portrait-slider d-flex flex-column">
<Carousel itemsToShow={1} isRTL={true} enableTilt={true} showArrows={false}> <Carousel
itemsToShow={1}
isRTL={true}
enableTilt={true}
showArrows={false}
>
{options.map((row, i) => ( {options.map((row, i) => (
<Row row={row} key={i} action={action} /> <Row row={row} key={i} action={action} />
))} ))}
@ -25,7 +30,10 @@ const Row = ({ row, action }) => {
const KeyboardItem = ({ item, action }) => { const KeyboardItem = ({ item, action }) => {
return ( return (
<div className="chat-suggest__row--item d-flex" onclick={() => action(item)}> <div
className="chat-suggest__row--item d-flex"
onclick={() => action(item)}
>
{item.text} {item.text}
</div> </div>
); );

@ -1,36 +1,36 @@
import React, { Component } from 'react'; import React, { Component } from "react";
import Avatar from '@material-ui/core/Avatar';
import './index.scss'; import "./index.scss";
import { toast } from 'react-toastify'; import { toast } from "react-toastify";
export default class Message2D extends Component { export default class Message2D extends Component {
state = { value: this.props.message.value }; state = { value: this.props.message.value };
click(id) { click(id) {
if (this.props.isActive) { if (this.props.isActive) {
this.setState({ value: id }); this.setState({ value: id });
toast.success('ثبت شد'); toast.success("ثبت شد");
this.props.action(); this.props.action();
} }
} }
render() { render() {
const { message, user, isSelf, isActive, action } = this.props; const { message } = this.props;
return ( return (
<div className="message-2d d-flex flex-column d-flex"> <div className="message-2d d-flex flex-column d-flex">
<div className="message-2d__options d-flex flex-column"> <div className="message-2d__options d-flex flex-column">
{message.options.map((option, i) => ( {message.options.map((option, i) => (
<div <div
key={message.id + '_' + option.id + '_' + i} key={message.id + "_" + option.id + "_" + i}
className="message-2d__options--row d-flex" className="message-2d__options--row d-flex"
> >
{option.map((item, i) => ( {option.map((item, i) => (
<div <div
key={message.id + '_' + item.id + '_' + i} key={message.id + "_" + item.id + "_" + i}
className="d-flex" className="d-flex"
style={{ style={{
width: `calc(100% / ${option.length} )`, width: `calc(100% / ${option.length} )`,
backgroundColor: item.id == this.state.value ? '#64cd82' : '', backgroundColor:
item.id === this.state.value ? "#64cd82" : "",
}} }}
onClick={() => this.click(item.id)} onClick={() => this.click(item.id)}
> >

@ -1,7 +1,6 @@
import React, { Component } from 'react'; import React, { Component } from "react";
import ArrowRightAltIcon from '@material-ui/icons/ArrowRightAlt'; import ArrowRightAltIcon from "@material-ui/icons/ArrowRightAlt";
import Avatar from '@material-ui/core/Avatar'; import { toast } from "react-toastify";
import { toast } from 'react-toastify';
export default class RadioMessage extends Component { export default class RadioMessage extends Component {
constructor(props) { constructor(props) {
@ -19,18 +18,27 @@ export default class RadioMessage extends Component {
}; };
render() { render() {
const { message, user, isSelf, isActive } = this.props; const { message, isActive } = this.props;
return ( return (
<div className="message-2d d-flex flex-column d-flex"> <div className="message-2d d-flex flex-column d-flex">
<div className="message-2d__options d-flex flex-wrap justify-content-center"> <div className="message-2d__options d-flex flex-wrap justify-content-center">
{message.options.map((row) => ( {message.options.map((row) => (
<Row list={row} handleRadioChange={this.handleRadioChange} value={this.state.value} /> <Row
list={row}
handleRadioChange={this.handleRadioChange}
value={this.state.value}
/>
))} ))}
</div> </div>
{isActive && ( {isActive && (
<button className="message-2d__submit" onClick={() => toast.success('ثبت شد')}> <button
className="message-2d__submit"
onClick={() => toast.success("ثبت شد")}
>
ثبت ثبت
<ArrowRightAltIcon style={{ color: 'white', width: 32, height: 32, marginLeft: 10 }} /> <ArrowRightAltIcon
style={{ color: "white", width: 32, height: 32, marginLeft: 10 }}
/>
</button> </button>
)} )}
</div> </div>
@ -53,8 +61,11 @@ const Item = (props) => {
<div <div
onClick={() => props.handleRadioChange(props.item.name)} onClick={() => props.handleRadioChange(props.item.name)}
style={{ style={{
backgroundColor: props.item.name === props.value ? '#6f42c1' : 'rgb(181 224 252 / 47%)', backgroundColor:
color: props.item.name === props.value ? 'white' : 'black', props.item.name === props.value
? "#6f42c1"
: "rgb(181 224 252 / 47%)",
color: props.item.name === props.value ? "white" : "black",
}} }}
> >
{props.item.name} {props.item.name}

@ -52,7 +52,7 @@ export default class NormalMessage extends Component {
addcounter, addcounter,
} = this.props; } = this.props;
const { messageMenu } = this.state; const { messageMenu } = this.state;
const hasavatar = prevUserId != message.userId; const hasavatar = prevUserId !== message.userId;
return ( return (
<div <div
@ -88,7 +88,7 @@ export default class NormalMessage extends Component {
> >
<div <div
className={ className={
message.type == "text" message.type === "text"
? `normal-message__box ` ? `normal-message__box `
: `normal-message__box normal-message__box--file` : `normal-message__box normal-message__box--file`
} }
@ -142,15 +142,15 @@ export default class NormalMessage extends Component {
)} )}
</div> </div>
{message.type == "text" ? ( {message.type === "text" ? (
<p style={{ color: isSelf ? "black" : "black" }}> <p style={{ color: isSelf ? "black" : "black" }}>
{message.text} {message.text}
</p> </p>
) : null} ) : null}
{message.type == "voice" ? ( {message.type === "voice" ? (
<ReactAudioPlayer src={file(message.fileId)} controls /> <ReactAudioPlayer src={file(message.fileId)} controls />
) : null} ) : null}
{message.type == "image" ? ( {message.type === "image" ? (
<div className="normal-message__box--caption"> <div className="normal-message__box--caption">
<a href={file(message.fileId)} download> <a href={file(message.fileId)} download>
<img src={file(message.fileId)} download alt="" /> <img src={file(message.fileId)} download alt="" />
@ -160,7 +160,7 @@ export default class NormalMessage extends Component {
</p> </p>
</div> </div>
) : null} ) : null}
{message.type == "video" ? ( {message.type === "video" ? (
<div className="normal-message__box--caption"> <div className="normal-message__box--caption">
<a href={file(message.fileId)} download> <a href={file(message.fileId)} download>
<ReactPlayer <ReactPlayer
@ -175,7 +175,7 @@ export default class NormalMessage extends Component {
</p> </p>
</div> </div>
) : null} ) : null}
{message.type == "audio" ? ( {message.type === "audio" ? (
<div className="normal-message__box--caption"> <div className="normal-message__box--caption">
<ReactAudioPlayer src={file(message.fileId)} controls /> <ReactAudioPlayer src={file(message.fileId)} controls />
<p style={{ color: isSelf ? "black" : "black" }}> <p style={{ color: isSelf ? "black" : "black" }}>
@ -183,7 +183,7 @@ export default class NormalMessage extends Component {
</p> </p>
</div> </div>
) : null} ) : null}
{message.type == "document" ? ( {message.type === "document" ? (
<a <a
href={file(message.fileId)} href={file(message.fileId)}
download download
@ -211,7 +211,7 @@ export default class NormalMessage extends Component {
} }
> >
<span style={{ color: isSelf ? "#aaa" : "gray" }}> <span style={{ color: isSelf ? "#aaa" : "gray" }}>
{message.updatedAt != message.createdAt ? ( {message.updatedAt !== message.createdAt ? (
<> <>
<span> ویرایش در</span> <span> ویرایش در</span>
@ -227,11 +227,13 @@ export default class NormalMessage extends Component {
padding: "0 2px", padding: "0 2px",
}} }}
> >
{isSelf && message.status == 0 && ( {isSelf && message.status === 0 && (
<ScheduleIcon fontSize="small" /> <ScheduleIcon fontSize="small" />
)} )}
{isSelf && message.status == 2 && <DoneIcon fontSize="small" />} {isSelf && message.status === 2 && (
{isSelf && message.status == 1 && ( <DoneIcon fontSize="small" />
)}
{isSelf && message.status === 1 && (
<DoneAllIcon <DoneAllIcon
fontSize="small" fontSize="small"
style={{ color: "#00afea", fontSize: "17px" }} style={{ color: "#00afea", fontSize: "17px" }}

@ -1,5 +1,5 @@
import React, { Component } from 'react'; import React, { Component } from "react";
import ArrowRightAltIcon from '@material-ui/icons/ArrowRightAlt'; import ArrowRightAltIcon from "@material-ui/icons/ArrowRightAlt";
export default class RadioMessage extends Component { export default class RadioMessage extends Component {
state = { state = {
@ -10,17 +10,24 @@ export default class RadioMessage extends Component {
}; };
render() { render() {
const { message, user, isSelf, isActive, action } = this.props; const { message, isActive, action } = this.props;
const { value } = this.state; const { value } = this.state;
return ( return (
<div className="message-2d d-flex flex-column d-flex"> <div className="message-2d d-flex flex-column d-flex">
<div className="message-2d__options d-flex flex-wrap justify-content-center"> <div className="message-2d__options d-flex flex-wrap justify-content-center">
{message.options.map((row) => ( {message.options.map((row) => (
<Row list={row} handleRadioChange={this.handleRadioChange} value={value} /> <Row
list={row}
handleRadioChange={this.handleRadioChange}
value={value}
/>
))} ))}
</div> </div>
{isActive && ( {isActive && (
<button className="message-2d__submit" onClick={() => action({ value })}> <button
className="message-2d__submit"
onClick={() => action({ value })}
>
ثبت ثبت
<ArrowRightAltIcon /> <ArrowRightAltIcon />
</button> </button>
@ -46,8 +53,10 @@ const Item = (props) => {
onClick={() => props.handleRadioChange(props.item.name)} onClick={() => props.handleRadioChange(props.item.name)}
style={{ style={{
backgroundColor: backgroundColor:
props.item.name === props.value ? 'rgb(100, 205, 130)' : 'rgba(255, 255, 255, 0.4)', props.item.name === props.value
color: props.item.name === props.value ? 'white' : 'black', ? "rgb(100, 205, 130)"
: "rgba(255, 255, 255, 0.4)",
color: props.item.name === props.value ? "white" : "black",
}} }}
> >
{props.item.name} {props.item.name}

@ -1,17 +1,16 @@
import React, { Component } from 'react'; import React, { Component } from "react";
import Grid from '@material-ui/core/Grid'; import Grid from "@material-ui/core/Grid";
import Slider from '@material-ui/core/Slider'; import Slider from "@material-ui/core/Slider";
import Input from '@material-ui/core/Input'; import Input from "@material-ui/core/Input";
import ArrowRightAltIcon from '@material-ui/icons/ArrowRightAlt'; import ArrowRightAltIcon from "@material-ui/icons/ArrowRightAlt";
import Avatar from '@material-ui/core/Avatar';
import { toast } from 'react-toastify';
export default class SliderMessage extends Component { export default class SliderMessage extends Component {
state = { state = {
value: this.props.message.value || 0, value: this.props.message.value || 0,
}; };
onChange = (value) => { onChange = (value) => {
if (!this.props.isActive || !value) return; 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))) }); this.setState({ value: Math.min(max, Math.max(min, parseFloat(value))) });
}; };
@ -44,8 +43,8 @@ export default class SliderMessage extends Component {
step: step, step: step,
min: min, min: min,
max: max, max: max,
type: 'number', type: "number",
'aria-labelledby': 'input-slider', "aria-labelledby": "input-slider",
}} }}
/> />
</Grid> </Grid>

@ -1,9 +1,7 @@
import React, { Component, useEffect } from 'react'; import React, { Component } from "react";
import { SortableContainer, SortableElement } from 'react-sortable-hoc'; import { SortableContainer, SortableElement } from "react-sortable-hoc";
import arrayMove from 'array-move'; import arrayMove from "array-move";
import ArrowRightAltIcon from '@material-ui/icons/ArrowRightAlt'; import ArrowRightAltIcon from "@material-ui/icons/ArrowRightAlt";
import Avatar from '@material-ui/core/Avatar';
import { toast } from 'react-toastify';
export default class DraggableMessage extends Component { export default class DraggableMessage extends Component {
constructor(props) { constructor(props) {
@ -18,11 +16,15 @@ export default class DraggableMessage extends Component {
}; };
render() { render() {
const { message, user, isSelf, isActive, action } = this.props; const { isActive, action } = this.props;
return ( return (
<div className="message-2d d-flex flex-column d-flex"> <div className="message-2d d-flex flex-column d-flex">
<SortableList items={this.state.options} onSortEnd={this.onSortEnd} disabled={!isActive} /> <SortableList
items={this.state.options}
onSortEnd={this.onSortEnd}
disabled={!isActive}
/>
{isActive && ( {isActive && (
<button className="message-2d__submit" onClick={() => action()}> <button className="message-2d__submit" onClick={() => action()}>
ثبت ثبت
@ -38,7 +40,12 @@ const SortableList = SortableContainer(({ items, disabled }) => {
return ( return (
<div className="message-2d__options d-flex flex-column"> <div className="message-2d__options d-flex flex-column">
{items.map((row, index) => ( {items.map((row, index) => (
<SortableItem key={`item-${index}`} index={index} value={row} disabled={disabled} /> <SortableItem
key={`item-${index}`}
index={index}
value={row}
disabled={disabled}
/>
))} ))}
</div> </div>
); );

@ -1,6 +1,6 @@
import React, { Component } from 'react'; import React, { Component } from "react";
import arrayMove from 'array-move'; import arrayMove from "array-move";
import './index.scss'; import "./index.scss";
export default class DraggableMessage extends Component { export default class DraggableMessage extends Component {
constructor(props) { constructor(props) {
@ -15,12 +15,15 @@ export default class DraggableMessage extends Component {
}; };
render() { render() {
const { message, user, isSelf, isActive } = this.props; const { isActive } = this.props;
if (!isActive) return null; if (!isActive) return null;
return <div className="ptapbox"></div>; return <div className="ptapbox"></div>;
} }
a = ( a = (
<button className="message-2d__submit" onClick={(e) => this.props.action({ value : e.target.value })}> <button
className="message-2d__submit"
onClick={(e) => this.props.action({ value: e.target.value })}
>
ثبت ثبت
</button> </button>
); );

@ -1,14 +1,13 @@
import React, { Component } from 'react'; import React, { Component } from "react";
import Normal from './Normal'; import Normal from "./Normal";
import Inline from './Inline'; import Inline from "./Inline";
import Sort from './Sort'; import Sort from "./Sort";
import Slider from './Slider'; import Slider from "./Slider";
import Select from './Select'; import Select from "./Select";
import MultiSelect from './MultiSelect'; import MultiSelect from "./MultiSelect";
import Tap from './Tap'; import Tap from "./Tap";
import ArrowRightAltIcon from '@material-ui/icons/ArrowRightAlt';
import './index.scss'; import "./index.scss";
const types = { const types = {
sort: Sort, sort: Sort,
inline: Inline, inline: Inline,
@ -19,7 +18,16 @@ const types = {
}; };
export default class Message extends Component { export default class Message extends Component {
render() { 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]; const Action = types[message.action];
return ( return (
<div className="Message"> <div className="Message">
@ -33,7 +41,12 @@ export default class Message extends Component {
document={document} document={document}
> >
{Action ? ( {Action ? (
<Action message={message} isSelf={isSelf} isActive={isActive} action={addcounter} /> <Action
message={message}
isSelf={isSelf}
isActive={isActive}
action={addcounter}
/>
) : null} ) : null}
{/* {isActive && ( {/* {isActive && (
<button className="message-2d__submit" onClick={() => action({ value })}> <button className="message-2d__submit" onClick={() => action({ value })}>

@ -382,11 +382,11 @@ class List extends Component {
return color; return color;
} }
render() { render() {
const { setPage, chatInfo, messageList: msaster, userId } = this.props; //last const { chatInfo, messageList: msaster } = this.props; //last
const messageList = msaster.slice(0, this.state.counter); const messageList = msaster.slice(0, this.state.counter);
const last = messageList.slice(-1)[0] || {}; const last = messageList.slice(-1)[0] || {};
const userIdx = this.userIdx || {}; const userIdx = this.userIdx || {};
if (Object.keys(userIdx).length == 0) { if (Object.keys(userIdx).length === 0) {
chatInfo.users.map( chatInfo.users.map(
(e) => (userIdx[e.id] = { ...e, color: this.randomColor() }) (e) => (userIdx[e.id] = { ...e, color: this.randomColor() })
); );
@ -417,7 +417,7 @@ class List extends Component {
this.state.video === null ? ( this.state.video === null ? (
<Message <Message
addcounter={() => this.addcounter()} addcounter={() => this.addcounter()}
isActive={message.id == last.id} isActive={message.id === last.id}
prevUserId={i > 0 ? messageList[i - 1].userId : 0} prevUserId={i > 0 ? messageList[i - 1].userId : 0}
isSelf={new Set([101, 103, 106, 108, 110]).has( isSelf={new Set([101, 103, 106, 108, 110]).has(
message.userId * 1 message.userId * 1
@ -477,7 +477,7 @@ class List extends Component {
className="chat-body__footer d-flex nobar d-flex flex-column" className="chat-body__footer d-flex nobar d-flex flex-column"
onClick={() => this.addcounter("nothing")} onClick={() => this.addcounter("nothing")}
> >
{last.action == "text" ? ( {last.action === "text" ? (
<ChatInputs <ChatInputs
addcounter={() => this.addcounter()} addcounter={() => this.addcounter()}
onStop={this.onStop} onStop={this.onStop}
@ -529,7 +529,7 @@ class List extends Component {
this.state.video === null ? ( this.state.video === null ? (
<Message <Message
addcounter={() => this.addcounter()} addcounter={() => this.addcounter()}
isActive={message.id == last.id} isActive={message.id === last.id}
prevUserId={i > 0 ? messageList[i - 1].userId : 0} prevUserId={i > 0 ? messageList[i - 1].userId : 0}
isSelf={new Set([101, 103, 106, 108, 110]).has( isSelf={new Set([101, 103, 106, 108, 110]).has(
message.userId * 1 message.userId * 1
@ -589,7 +589,7 @@ class List extends Component {
className="desktop-chat-body__footer d-flex nobar d-flex flex-column" className="desktop-chat-body__footer d-flex nobar d-flex flex-column"
onClick={() => this.addcounter("nothing")} onClick={() => this.addcounter("nothing")}
> >
{last.action == "text" ? ( {last.action === "text" ? (
<ChatInputs <ChatInputs
addcounter={() => this.addcounter()} addcounter={() => this.addcounter()}
onStop={this.onStop} onStop={this.onStop}

@ -3,9 +3,7 @@ import MoreVertIcon from "@material-ui/icons/MoreVert";
import ArrowForwardIcon from "@material-ui/icons/ArrowForward"; import ArrowForwardIcon from "@material-ui/icons/ArrowForward";
import Menu from "@material-ui/core/Menu"; import Menu from "@material-ui/core/Menu";
import MenuItem from "@material-ui/core/MenuItem"; import MenuItem from "@material-ui/core/MenuItem";
import VideocamIcon from "@material-ui/icons/Videocam";
import StatusAvatar from "./Avatar/index.js"; import StatusAvatar from "./Avatar/index.js";
import CallIcon from "@material-ui/icons/Call";
import { connect } from "react-redux"; import { connect } from "react-redux";
import "./index.scss"; import "./index.scss";

@ -1,16 +1,15 @@
import React, { Component } from "react"; import React, { Component } from "react";
import ChatIcon from "@material-ui/icons/Chat";
import FileTabs from "./FileTabs"; import FileTabs from "./FileTabs";
import Gallery from "./Gallery";
import VideocamOutlinedIcon from "@material-ui/icons/VideocamOutlined"; import VideocamOutlinedIcon from "@material-ui/icons/VideocamOutlined";
import CallOutlinedIcon from "@material-ui/icons/CallOutlined"; import CallOutlinedIcon from "@material-ui/icons/CallOutlined";
import MoreHorizOutlinedIcon from "@material-ui/icons/MoreHorizOutlined"; import MoreHorizOutlinedIcon from "@material-ui/icons/MoreHorizOutlined";
import Switch from "@material-ui/core/Switch"; import Switch from "@material-ui/core/Switch";
import { withStyles } from "@material-ui/core/styles"; import { withStyles } from "@material-ui/core/styles";
import BlockIcon from '@material-ui/icons/Block'; import BlockIcon from "@material-ui/icons/Block";
import KeyboardArrowLeftIcon from '@material-ui/icons/KeyboardArrowLeft'; import KeyboardArrowLeftIcon from "@material-ui/icons/KeyboardArrowLeft";
import KeyboardBackspaceIcon from '@material-ui/icons/KeyboardBackspace'; import KeyboardBackspaceIcon from "@material-ui/icons/KeyboardBackspace";
import CloseIcon from '@material-ui/icons/Close'; import CloseIcon from "@material-ui/icons/Close";
import user2 from "../../../assets/images/user2.png"; import user2 from "../../../assets/images/user2.png";
@ -39,7 +38,7 @@ export default class ChatInfo extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
gallery : false, gallery: false,
alarms: false, alarms: false,
buttons: [ buttons: [
{ {
@ -99,135 +98,217 @@ export default class ChatInfo extends Component {
}; };
render() { render() {
const { user, gallery, buttons, alarms } = this.state; const { user, buttons, alarms } = this.state;
return ( return (
<> <>
{window.innerWidth > 1000 ? ( {window.innerWidth > 1000 ? (
<section className="desktop-contact-info d-flex flex-column"> <section className="desktop-contact-info d-flex flex-column">
<header className="desktop-contact-info__header d-flex align-items-center justify-content-center"> <header className="desktop-contact-info__header d-flex align-items-center justify-content-center">
{ {this.state.gallery ? (
this.state.gallery ? <KeyboardBackspaceIcon
<KeyboardBackspaceIcon onClick={() => this.setState({ gallery: false})} style={{ cursor: 'pointer', width: 35, height: 35, position: 'absolute', left: 10, top: 10}} /> : onClick={() => this.setState({ gallery: false })}
<CloseIcon onClick={ () => this.props.parent.handleDrawerClose()} style={{ cursor: 'pointer', width: 35, height: 35, position: 'absolute', left: 10, top: 10}} /> style={{
} cursor: "pointer",
width: 35,
height: 35,
position: "absolute",
left: 10,
top: 10,
}}
/>
) : (
<CloseIcon
onClick={() => this.props.parent.handleDrawerClose()}
style={{
cursor: "pointer",
width: 35,
height: 35,
position: "absolute",
left: 10,
top: 10,
}}
/>
)}
</header> </header>
{ {!this.state.gallery ? (
!this.state.gallery ?
<div className="desktop-contact-info__body d-flex flex-column align-items-center"> <div className="desktop-contact-info__body d-flex flex-column align-items-center">
<img <img
className="desktop-contact-info__body--profileImage" className="desktop-contact-info__body--profileImage"
src={user.profileImages[0].src} src={user.profileImages[0].src}
alt="عکس کاربر" alt="عکس کاربر"
/> />
<h1 style={{ fontSize: fontSize.desktop.h1 }}>{user.name}</h1> <h1 style={{ fontSize: fontSize.desktop.h1 }}>{user.name}</h1>
<div className="desktop-contact-info__body--bio d-flex flex-column"> <div className="desktop-contact-info__body--bio d-flex flex-column">
<h2 style={{ fontSize: fontSize.desktop.h2 }}>اطلاعات</h2> <h2 style={{ fontSize: fontSize.desktop.h2 }}>اطلاعات</h2>
<p style={{ fontSize: fontSize.desktop.p }}>{user.bio}</p> <p style={{ fontSize: fontSize.desktop.p }}>{user.bio}</p>
<h2 style={{ fontSize: fontSize.desktop.h2 }}>مشخصات تحصیلی</h2> <h2 style={{ fontSize: fontSize.desktop.h2 }}>
<ul> مشخصات تحصیلی
{user.educationalInfo.map((item, i) => ( </h2>
<li key={i} style={{ fontSize: fontSize.desktop.p}}>{item}</li> <ul>
{user.educationalInfo.map((item, i) => (
<li key={i} style={{ fontSize: fontSize.desktop.p }}>
{item}
</li>
))}
</ul>
</div>
<div className="desktop-contact-info__body--buttons d-flex justify-content-around mt-3">
{buttons.map((item, i) => (
<li
style={{ backgroundColor: item.backgroundColor }}
key={i}
>
{item.icon}
</li>
))} ))}
</ul>
</div>
<div className="desktop-contact-info__body--buttons d-flex justify-content-around mt-3">
{buttons.map((item, i) => (
<li style={{ backgroundColor: item.backgroundColor }} key={i}>
{item.icon}
</li>
))}
</div>
<div className="desktop-contact-info__body--options d-flex justify-content-between">
<h3 style={{ fontSize: fontSize.desktop.h3 }}>نام کاربری</h3>
<span style={{ fontSize: fontSize.desktop.span }}>
{user.username}@
</span>
</div>
<div className="desktop-contact-info__body--options d-flex justify-content-between align-items-center">
<div>
<h3 style={{ fontSize: fontSize.desktop.h3 }}>اعلانات</h3>
<span style={{ fontSize: fontSize.desktop.span }}>{alarms ? 'روشن ': 'خاموش'}</span>
</div> </div>
<AntSwitch <div className="desktop-contact-info__body--options d-flex justify-content-between">
checked={alarms} <h3 style={{ fontSize: fontSize.desktop.h3 }}>نام کاربری</h3>
onChange={() => this.handleChange()} <span style={{ fontSize: fontSize.desktop.span }}>
/> {user.username}@
</div> </span>
<div className="desktop-contact-info__body--options desktop-contact-info__body--options__click d-flex justify-content-between align-items-center" onClick={() => this.setState({ gallery: true })}> </div>
<h3 style={{ fontSize: fontSize.desktop.h3 }}>رسانه,فیلم,عکس</h3> <div className="desktop-contact-info__body--options d-flex justify-content-between align-items-center">
<KeyboardArrowLeftIcon style={{width : 30, height : 30, color : 'grey'}} /> <div>
</div> <h3 style={{ fontSize: fontSize.desktop.h3 }}>اعلانات</h3>
<div className="desktop-contact-info__body--options desktop-contact-info__body--options__click d-flex justify-content-between align-items-center"> <span style={{ fontSize: fontSize.desktop.span }}>
<h3 style={{ color : 'red',fontSize: fontSize.desktop.h3 }}>مسدود سازی مخاطب</h3> {alarms ? "روشن " : "خاموش"}
<BlockIcon style={{width : 30, height : 30, color : 'red'}} /> </span>
</div>
<AntSwitch
checked={alarms}
onChange={() => this.handleChange()}
/>
</div>
<div
className="desktop-contact-info__body--options desktop-contact-info__body--options__click d-flex justify-content-between align-items-center"
onClick={() => this.setState({ gallery: true })}
>
<h3 style={{ fontSize: fontSize.desktop.h3 }}>
رسانه,فیلم,عکس
</h3>
<KeyboardArrowLeftIcon
style={{ width: 30, height: 30, color: "grey" }}
/>
</div>
<div className="desktop-contact-info__body--options desktop-contact-info__body--options__click d-flex justify-content-between align-items-center">
<h3 style={{ color: "red", fontSize: fontSize.desktop.h3 }}>
مسدود سازی مخاطب
</h3>
<BlockIcon style={{ width: 30, height: 30, color: "red" }} />
</div>
</div> </div>
</div> : <FileTabs /> ) : (
} <FileTabs />
)}
</section> </section>
) : null} ) : null}
{window.innerWidth < 1000 ? ( {window.innerWidth < 1000 ? (
<section className="desktop-contact-info d-flex flex-column"> <section className="desktop-contact-info d-flex flex-column">
<header className="desktop-contact-info__header d-flex align-items-center justify-content-center"> <header className="desktop-contact-info__header d-flex align-items-center justify-content-center">
{ {this.state.gallery ? (
this.state.gallery ? <KeyboardBackspaceIcon
<KeyboardBackspaceIcon onClick={() => this.setState({ gallery: false})} style={{ cursor: 'pointer', width: 35, height: 35, position: 'absolute', left: 10, top: 10}} /> : onClick={() => this.setState({ gallery: false })}
<CloseIcon onClick={ () => window.innerWidth > 1000 ? this.props.parent.handleDrawerClose() : this.props.parent.setState({ page : 'chatroom' })} style={{ cursor: 'pointer', width: 35, height: 35, position: 'absolute', left: 10, top: 10}} /> style={{
} cursor: "pointer",
width: 35,
height: 35,
position: "absolute",
left: 10,
top: 10,
}}
/>
) : (
<CloseIcon
onClick={() =>
window.innerWidth > 1000
? this.props.parent.handleDrawerClose()
: this.props.parent.setState({ page: "chatroom" })
}
style={{
cursor: "pointer",
width: 35,
height: 35,
position: "absolute",
left: 10,
top: 10,
}}
/>
)}
</header> </header>
{ {!this.state.gallery ? (
!this.state.gallery ?
<div className="desktop-contact-info__body d-flex flex-column align-items-center"> <div className="desktop-contact-info__body d-flex flex-column align-items-center">
<img <img
className="desktop-contact-info__body--profileImage" className="desktop-contact-info__body--profileImage"
src={user.profileImages[0].src} src={user.profileImages[0].src}
alt="عکس کاربر" alt="عکس کاربر"
/> />
<h1 style={{ fontSize: fontSize.mobile.h1 }}>{user.name}</h1> <h1 style={{ fontSize: fontSize.mobile.h1 }}>{user.name}</h1>
<div className="desktop-contact-info__body--bio d-flex flex-column"> <div className="desktop-contact-info__body--bio d-flex flex-column">
<h2 style={{ fontSize: fontSize.mobile.h2 }}>اطلاعات</h2> <h2 style={{ fontSize: fontSize.mobile.h2 }}>اطلاعات</h2>
<p style={{ fontSize: fontSize.mobile.p }}>{user.bio}</p> <p style={{ fontSize: fontSize.mobile.p }}>{user.bio}</p>
<h2 style={{ fontSize: fontSize.mobile.h2 }}>مشخصات تحصیلی</h2> <h2 style={{ fontSize: fontSize.mobile.h2 }}>
<ul> مشخصات تحصیلی
{user.educationalInfo.map((item, i) => ( </h2>
<li key={i} style={{ fontSize: fontSize.mobile.p}}>{item}</li> <ul>
{user.educationalInfo.map((item, i) => (
<li key={i} style={{ fontSize: fontSize.mobile.p }}>
{item}
</li>
))}
</ul>
</div>
<div className="desktop-contact-info__body--buttons d-flex justify-content-around">
{buttons.map((item, i) => (
<li
style={{ backgroundColor: item.backgroundColor }}
key={i}
>
{item.icon}
</li>
))} ))}
</ul>
</div>
<div className="desktop-contact-info__body--buttons d-flex justify-content-around">
{buttons.map((item, i) => (
<li style={{ backgroundColor: item.backgroundColor }} key={i}>
{item.icon}
</li>
))}
</div>
<div className="desktop-contact-info__body--options d-flex justify-content-between">
<h3 style={{ fontSize: fontSize.mobile.h3 }}>نام کاربری</h3>
<span style={{ fontSize: fontSize.mobile.span }}>
{user.username}@
</span>
</div>
<div className="desktop-contact-info__body--options d-flex justify-content-between align-items-center">
<div>
<h3 style={{ fontSize: fontSize.mobile.h3 }}>اعلانات</h3>
<span style={{ fontSize: fontSize.mobile.span }}>{alarms ? 'روشن ': 'خاموش'}</span>
</div> </div>
<AntSwitch <div className="desktop-contact-info__body--options d-flex justify-content-between">
checked={alarms} <h3 style={{ fontSize: fontSize.mobile.h3 }}>نام کاربری</h3>
onChange={() => this.handleChange()} <span style={{ fontSize: fontSize.mobile.span }}>
/> {user.username}@
</div> </span>
<div className="desktop-contact-info__body--options desktop-contact-info__body--options__click d-flex justify-content-between align-items-center" onClick={() => this.setState({ gallery: true })}> </div>
<h3 style={{ fontSize: fontSize.mobile.h3 }}>رسانه,فیلم,عکس</h3> <div className="desktop-contact-info__body--options d-flex justify-content-between align-items-center">
<KeyboardArrowLeftIcon style={{width : 30, height : 30, color : 'grey'}} /> <div>
</div> <h3 style={{ fontSize: fontSize.mobile.h3 }}>اعلانات</h3>
<div className="desktop-contact-info__body--options desktop-contact-info__body--options__click d-flex justify-content-between align-items-center"> <span style={{ fontSize: fontSize.mobile.span }}>
<h3 style={{ color : 'red',fontSize: fontSize.mobile.h3 }}>مسدود سازی مخاطب</h3> {alarms ? "روشن " : "خاموش"}
<BlockIcon style={{width : 30, height : 30, color : 'red'}} /> </span>
</div>
<AntSwitch
checked={alarms}
onChange={() => this.handleChange()}
/>
</div>
<div
className="desktop-contact-info__body--options desktop-contact-info__body--options__click d-flex justify-content-between align-items-center"
onClick={() => this.setState({ gallery: true })}
>
<h3 style={{ fontSize: fontSize.mobile.h3 }}>
رسانه,فیلم,عکس
</h3>
<KeyboardArrowLeftIcon
style={{ width: 30, height: 30, color: "grey" }}
/>
</div>
<div className="desktop-contact-info__body--options desktop-contact-info__body--options__click d-flex justify-content-between align-items-center">
<h3 style={{ color: "red", fontSize: fontSize.mobile.h3 }}>
مسدود سازی مخاطب
</h3>
<BlockIcon style={{ width: 30, height: 30, color: "red" }} />
</div>
</div> </div>
</div> : <FileTabs /> ) : (
} <FileTabs />
)}
</section> </section>
) : null} ) : null}
</> </>

@ -13,17 +13,24 @@ const useStyles = makeStyles((theme) => ({
}, },
})); }));
export default function FormPropsTextFields(props) { export default function FormPropsTextFields({
parent,
name,
label,
multiline,
}) {
const classes = useStyles(); const classes = useStyles();
return ( return (
<form className={classes.root} noValidate autoComplete="off"> <form className={classes.root} noValidate autoComplete="off">
<div> <div>
<TextField <TextField
multiline={multiline}
id="outlined-basic" id="outlined-basic"
name={props.name} name={name}
label={props.label} label={label}
variant="outlined" variant="outlined"
onChange={(e) => parent.onChange(name, e.target.value)}
/> />
</div> </div>
</form> </form>

@ -35,7 +35,6 @@ const useStyles = makeStyles((theme) => ({
export default function CustomizedSelects(props) { export default function CustomizedSelects(props) {
const classes = useStyles(); const classes = useStyles();
const [age, setAge] = React.useState("");
return ( return (
<div className="home-search__select mr-2" style={{ width: "100%" }}> <div className="home-search__select mr-2" style={{ width: "100%" }}>

@ -4,13 +4,7 @@ import { Link } from "react-router-dom";
import "./index.scss"; import "./index.scss";
function handleClick(event) {
event.preventDefault();
console.info("You clicked a breadcrumb.");
}
const maxDesktopSize = 1250; const maxDesktopSize = 1250;
const maxMobileSize = 650;
const fontSize = { const fontSize = {
desktop: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 90, desktop: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 90,
@ -18,7 +12,6 @@ const fontSize = {
}; };
export default function ActiveLastBreadcrumb(props) { export default function ActiveLastBreadcrumb(props) {
const { name } = props;
return ( return (
<Breadcrumbs aria-label="breadcrumb"> <Breadcrumbs aria-label="breadcrumb">
<Link <Link

@ -1,11 +1,8 @@
import React, { Component } from "react"; import React, { Component } from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { userProduct } from "~/Redux/actions"; import { userProduct } from "~/Redux/actions";
import { Link } from "react-router-dom";
import Navbar from "../Home/Navbar/index"; 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 BreadCrumbs from "./BreadCrumb/index";
import "./index.scss"; import "./index.scss";
@ -33,8 +30,6 @@ class AR extends Component {
} }
render() { render() {
const { arList, loading } = this.props;
return ( return (
<div className="ar d-flex flex-column"> <div className="ar d-flex flex-column">
<Navbar page="home" /> <Navbar page="home" />

@ -1,6 +1,5 @@
import React, { Component } from "react"; import React, { Component } from "react";
import proxy from "~/Redux/proxy";
import { toast } from "react-toastify";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { publicApi } from "~/Redux/actions"; import { publicApi } from "~/Redux/actions";

@ -1,15 +1,13 @@
import React, { Component } from "react"; import React, { Component } from "react";
import Product from "./Product/index";
import ChevronLeftIcon from "@material-ui/icons/ChevronLeft"; import Subject from "./Subject/index";
import Product from './Product/index'; import MyProduct from "./MyProduct/index";
import Subject from './Subject/index'; import dropdown from "../../../assets/icons/dropdown.png";
import MyProduct from './MyProduct/index';
import dropdown from '../../../assets/icons/dropdown.png';
import "./index.scss"; import "./index.scss";
export default class HomeScroll extends Component { export default class HomeScroll extends Component {
render() { render() {
const { data, height, title,designType, moreText, number } = this.props; const { data, height, title, designType, moreText, number } = this.props;
return ( return (
<div <div
className="mobile-home-scroll d-flex flex-column" className="mobile-home-scroll d-flex flex-column"
@ -19,11 +17,10 @@ export default class HomeScroll extends Component {
<div className="mobile-home-scroll__header--right d-flex"> <div className="mobile-home-scroll__header--right d-flex">
<h1>{title}</h1> <h1>{title}</h1>
<span></span> <span></span>
</div> </div>
<div className="mobile-home-scroll__header--more d-flex"> <div className="mobile-home-scroll__header--more d-flex">
<span>{moreText}</span> <span>{moreText}</span>
<img src={dropdown} alt='فلش' /> <img src={dropdown} alt="فلش" />
</div> </div>
</div> </div>
<div className="mobile-home-scroll__list d-flex"> <div className="mobile-home-scroll__list d-flex">
@ -39,18 +36,15 @@ export default class HomeScroll extends Component {
const Item = (props) => { const Item = (props) => {
return ( return (
<> <>
{ {props.designType === "product" ? (
props.designType === 'product' ? <Product data={props.data} number={props.number} />
<Product data={props.data} number={props.number} /> : null ) : null}
} {props.designType === "subjects" ? (
{ <Subject data={props.data} number={props.number} />
props.designType === 'subjects' ? ) : null}
<Subject data={props.data} number={props.number} /> : null {props.designType === "myProduct" ? (
} <MyProduct data={props.data} number={props.number} />
{ ) : null}
props.designType === 'myProduct' ?
<MyProduct data={props.data} number={props.number} /> : null
}
</> </>
); );
}; };

@ -45,8 +45,7 @@ const useStyles = makeStyles((theme) => ({
export default function CustomizedSelects(props) { export default function CustomizedSelects(props) {
const classes = useStyles(); const classes = useStyles();
const [age, setAge] = React.useState(""); const { name, parent } = props;
const { name, parent, options } = props;
return ( return (
<div className="home-search__select mr-2"> <div className="home-search__select mr-2">
<FormControl className={classes.margin}> <FormControl className={classes.margin}>

@ -24,7 +24,7 @@ class HomeSearch extends Component {
} }
render() { render() {
const { height, levels } = this.props; const { levels } = this.props;
return window.innerWidth > 1000 ? ( return window.innerWidth > 1000 ? (
<div className="home-search d-flex"> <div className="home-search d-flex">
<input <input

@ -50,7 +50,10 @@ export default class Simple extends Component {
) : null} ) : null}
<h1 style={{ fontSize: fontSize.desktop.h1 }}>{data.title}</h1> <h1 style={{ fontSize: fontSize.desktop.h1 }}>{data.title}</h1>
<h2 style={{ fontSize: fontSize.desktop.h2 }}> <h2 style={{ fontSize: fontSize.desktop.h2 }}>
{data.text.slice(0, 100)} ... <div
dangerouslySetInnerHTML={{ __html: data.text }}
style={{ height: 80, overflow: "hidden" }}
></div>
</h2> </h2>
<div className="slider-blog__footer d-flex mt-3"> <div className="slider-blog__footer d-flex mt-3">
<div className="d-flex"> <div className="d-flex">
@ -74,9 +77,9 @@ export default class Simple extends Component {
<span <span
className="slider-blog__category" className="slider-blog__category"
style={{ style={{
backgroundColor: colors.filter( backgroundColor:
(item) => item.name === data.tag colors.filter((item) => item.name === data.tag)[0]?.color ||
)[0].color, "#33333366",
fontSize: fontSize.desktop.span, fontSize: fontSize.desktop.span,
}} }}
> >
@ -106,7 +109,13 @@ export default class Simple extends Component {
<img src={music} alt={data.title} /> <img src={music} alt={data.title} />
) : null} ) : null}
<h1>{data.title}</h1> <h1>{data.title}</h1>
<h2>{data.text.slice(0, 100)}...</h2>
<h2>
<div
dangerouslySetInnerHTML={{ __html: data.text }}
style={{ height: 80, overflow: "hidden" }}
></div>
</h2>
<div className="mobile-slider-blog__footer d-flex mt-3"> <div className="mobile-slider-blog__footer d-flex mt-3">
<div className="d-flex"> <div className="d-flex">
{/* <img src={} /> */} {/* <img src={} /> */}

@ -17,7 +17,7 @@ const fontSize = {
export default class Simple extends Component { export default class Simple extends Component {
render() { render() {
const mobile = window.innerWidth < 1000; const mobile = window.innerWidth < 1000;
const { height, data } = this.props; const { data } = this.props;
const status = proxy.status(); const status = proxy.status();
return ( return (

@ -9,7 +9,7 @@ const fontSize = {
}; };
export default function Simple(props) { export default function Simple(props) {
const { data, status } = props; const { data } = props;
const parentStyle = { const parentStyle = {
// backgroundImage: `url('${data.imageUrl}')`, // backgroundImage: `url('${data.imageUrl}')`,
background: data.fileId background: data.fileId

@ -15,7 +15,7 @@ const fontSize = {
export default class HomeStatic extends Component { export default class HomeStatic extends Component {
render() { render() {
const status = proxy.status(); const status = proxy.status();
const { data, height, title, designType } = this.props; const { data, height, title } = this.props;
console.log(data); console.log(data);
return ( return (
<> <>

@ -1,16 +1,14 @@
import React, { Component } from "react"; import React, { Component } from "react";
import { Dropdown } from "react-bootstrap";
import proxy from "~/Redux/proxy"; import proxy from "~/Redux/proxy";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import Avatar from "@material-ui/core/Avatar"; import Avatar from "@material-ui/core/Avatar";
import logo from "~/assets/icons/logo.png"; import logo from "~/assets/icons/logo.png";
import basket from "~/assets/icons/basket.png"; import basket from "~/assets/icons/basket.png";
import KeyboardArrowUpIcon from "@material-ui/icons/KeyboardArrowUp";
import KeyboardArrowDownIcon from "@material-ui/icons/KeyboardArrowDown";
import MenuItem from "@material-ui/core/MenuItem"; import MenuItem from "@material-ui/core/MenuItem";
import Menu from "@material-ui/core/Menu"; import Menu from "@material-ui/core/Menu";
import { connect } from "react-redux"; import { connect } from "react-redux";
import AddCircleOutlineRoundedIcon from "@material-ui/icons/AddCircleOutlineRounded";
import "./index.scss"; import "./index.scss";
import { useHistory } from "react-router-dom"; import { useHistory } from "react-router-dom";
import { user } from "~/Redux/actions"; import { user } from "~/Redux/actions";
@ -31,7 +29,6 @@ class LaptopNavbar extends Component {
state = {}; state = {};
render() { render() {
let score = 0;
const { status } = this.props; const { status } = this.props;
if (this.state.navigatePath) return <Navigate path={this.navigatePath} />; if (this.state.navigatePath) return <Navigate path={this.navigatePath} />;
const { links } = this.props; const { links } = this.props;

@ -4,13 +4,11 @@ import AddCircleOutlineRoundedIcon from "@material-ui/icons/AddCircleOutlineRoun
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import { toast } from "react-toastify"; import { toast } from "react-toastify";
import Avatar from "@material-ui/core/Avatar"; import Avatar from "@material-ui/core/Avatar";
import CheckIcon from "@material-ui/icons/Check";
import KeyboardArrowUpIcon from "@material-ui/icons/KeyboardArrowUp"; import KeyboardArrowUpIcon from "@material-ui/icons/KeyboardArrowUp";
import KeyboardArrowDownIcon from "@material-ui/icons/KeyboardArrowDown"; import KeyboardArrowDownIcon from "@material-ui/icons/KeyboardArrowDown";
import { user } from "~/Redux/actions"; import { user } from "~/Redux/actions";
import user1 from "~/assets/images/user1.png";
import user2 from "~/assets/images/user2.png";
import mobileHome from "~/assets/icons/mobileHome.svg"; import mobileHome from "~/assets/icons/mobileHome.svg";
import mobileAr from "~/assets/icons/mobileAr.svg"; import mobileAr from "~/assets/icons/mobileAr.svg";
import qrcode from "~/assets/icons/drawer-qr.png"; import qrcode from "~/assets/icons/drawer-qr.png";
@ -44,6 +42,13 @@ class NavbarDrawer extends Component {
toast: "", toast: "",
message: "", message: "",
}, },
{
name: "درباره ما",
link: "/about",
icon: <img src={mobileBlog} alt="کتابهای من" />,
toast: "",
message: "",
},
{ {
name: "فروشگاه", name: "فروشگاه",
link: "/products", link: "/products",
@ -51,6 +56,13 @@ class NavbarDrawer extends Component {
toast: "", toast: "",
message: "", message: "",
}, },
{
name: "سبد خرید",
link: "/cart",
icon: <img src={mobileBlog} alt="کتابهای من" />,
toast: "",
message: "",
},
{ {
name: "بلاگ", name: "بلاگ",
link: "/blogs", link: "/blogs",
@ -247,39 +259,3 @@ class NavbarDrawer extends Component {
export default connect((state) => ({ status: state.user.status }), { export default connect((state) => ({ status: state.user.status }), {
logout: user.logout, logout: user.logout,
})(NavbarDrawer); })(NavbarDrawer);
const User = (props) => {
return (
<div
className="navbar-drawer-user d-flex align-items-center"
style={{ backgroundColor: props.data.status === 1 ? "#eee" : "white" }}
>
<Avatar
style={{ width: 55, height: 55 }}
alt={props.data.firstName + " " + props.data.lastName}
src={props.data.image}
/>
<div className="navbar-drawer-user__right d-flex flex-column">
<h1
style={{
color: props.data.status === 1 ? "#00CC69" : "#4D4D4F",
}}
>
{props.data.firstName + " " + props.data.lastName}
</h1>
<div
style={{
color: props.data.status === 1 ? "#00CC69" : "#4D4D4F",
}}
>
{props.data.title}
</div>
</div>
{props.data.status === 1 ? (
<div style={{ position: "absolute", left: 24, top: 16 }}>
<CheckIcon style={{ fontSize: 40, color: "#00CC69" }} />
</div>
) : null}
</div>
);
};

@ -1,4 +1,4 @@
import React, { useState, Component } from "react"; import React, { useState } from "react";
import { Link, useHistory } from "react-router-dom"; import { Link, useHistory } from "react-router-dom";
import { makeStyles } from "@material-ui/core/styles"; import { makeStyles } from "@material-ui/core/styles";
import { SwipeableDrawer } from "@material-ui/core"; import { SwipeableDrawer } from "@material-ui/core";
@ -23,20 +23,6 @@ function BackButton({ children }) {
); );
} }
const maxDesktopSize = 1250;
const maxMobileSize = 650;
const fontSize = {
desktop: {
li: window.innerWidth > maxDesktopSize ? 15 : window.innerWidth / 85,
a: window.innerWidth > maxDesktopSize ? 15 : window.innerWidth / 85,
},
mobile: {
h1: window.innerWidth > maxMobileSize ? 30 : window.innerWidth / 18,
p: window.innerWidth > maxMobileSize ? 18 : window.innerWidth / 28,
h2: window.innerWidth > maxMobileSize ? 20 : window.innerWidth / 23,
li: window.innerWidth > maxMobileSize ? 16 : window.innerWidth / 28,
},
};
const useStyles = makeStyles({ const useStyles = makeStyles({
list: { list: {
width: window.innerWidth * 0.8, width: window.innerWidth * 0.8,

@ -22,7 +22,7 @@ const fontSize = {
export default class SingleBlog extends Component { export default class SingleBlog extends Component {
render() { render() {
const { height, data, direction } = this.props; const { height, data } = this.props;
return ( return (
<div style={{ height: height }} className="single-blog d-flex"> <div style={{ height: height }} className="single-blog d-flex">
<div className="single-blog__right d-flex flex-column justify-content-center"> <div className="single-blog__right d-flex flex-column justify-content-center">

@ -53,11 +53,11 @@ class Home extends Component {
} }
//componentDidupdate = this.componentDidMount(); //componentDidupdate = this.componentDidMount();
render() { render() {
const { homeData, loading, status } = this.props; const { homeData, loading } = this.props;
if (!loading && this.props.homeData.length == 0) if (!loading && this.props.homeData.length === 0)
return this.componentDidMount(); return this.componentDidMount();
const mobile = window.innerWidth < 1000; const mobile = window.innerWidth < 1000;
if (loading && this.props.homeData.length == 0) if (loading && this.props.homeData.length === 0)
return ( return (
<div <div
className="d-flex justify-content-center align-items-center" className="d-flex justify-content-center align-items-center"

@ -4,13 +4,7 @@ import { Link } from "react-router-dom";
import "./index.scss"; import "./index.scss";
function handleClick(event) {
event.preventDefault();
console.info("You clicked a breadcrumb.");
}
const maxDesktopSize = 1250; const maxDesktopSize = 1250;
const maxMobileSize = 650;
const fontSize = { const fontSize = {
desktop: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 90, desktop: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 90,
@ -18,7 +12,6 @@ const fontSize = {
}; };
export default function ActiveLastBreadcrumb(props) { export default function ActiveLastBreadcrumb(props) {
const { name } = props;
return ( return (
<Breadcrumbs aria-label="breadcrumb" className="m-1"> <Breadcrumbs aria-label="breadcrumb" className="m-1">
<Link <Link

@ -118,7 +118,7 @@ export default connect(
)(MyBooks); )(MyBooks);
const Item = (props) => { const Item = (props) => {
const { data, id } = props; const { data } = props;
return ( return (
<> <>
{window.innerWidth < 1000 && {window.innerWidth < 1000 &&

@ -1,5 +1,5 @@
/* eslint-disable no-useless-escape */
import React, { Component } from "react"; import React, { Component } from "react";
import { user } from "~/Redux/actions";
import { connect } from "react-redux"; import { connect } from "react-redux";
import Select from "../Auth/Profile/Select/index"; import Select from "../Auth/Profile/Select/index";
@ -9,7 +9,6 @@ import Upload from "../Auth/Profile/Upload/index";
import Gender from "../Auth/Profile/GenderSwitch/index"; import Gender from "../Auth/Profile/GenderSwitch/index";
import Birthdate from "../Auth/Profile/Birthdate/index"; import Birthdate from "../Auth/Profile/Birthdate/index";
import MultipleSelector from "../Auth/Profile/MultipleSelector/index"; import MultipleSelector from "../Auth/Profile/MultipleSelector/index";
import Loader from "~/components/Loader/index";
import Document from "../Auth/Profile/Document/index"; import Document from "../Auth/Profile/Document/index";
import logo from "~/assets/icons/logo.png"; import logo from "~/assets/icons/logo.png";
@ -31,12 +30,6 @@ const fontSize = {
}, },
}; };
const toastMessages = {
firstName: "نام وارد شده صحیح نیست!",
lastName: "نام خانوادگی وارد شده صحیح نیست!",
username: "نام کاربری صحیح نیست.",
};
class NewProfile extends Component { class NewProfile extends Component {
state = { state = {
render: false, render: false,
@ -96,7 +89,6 @@ class NewProfile extends Component {
firstName, firstName,
lastName, lastName,
username, username,
cellphone,
password, password,
postalCode, postalCode,
address, address,
@ -193,7 +185,7 @@ class NewProfile extends Component {
}; };
render() { render() {
const { user, profile } = this.props; const { profile } = this.props;
const grades = [ const grades = [
"پیش دبستان", "پیش دبستان",
"اول", "اول",

@ -1,17 +1,15 @@
import React, { Component } from "react"; import React from "react";
import proxy from "~/Redux/proxy"; import proxy from "~/Redux/proxy";
import { toast } from "react-toastify"; import { toast } from "react-toastify";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { userProduct } from "~/Redux/actions"; import { userProduct } from "~/Redux/actions";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import Loader from "~/components/Loader/index";
import "./index.scss"; import "./index.scss";
import document_red from "~/assets/icons/document-red.png"; import document_red from "~/assets/icons/document-red.png";
import ebook_blue from "~/assets/icons/e-book-blue.png"; import ebook_blue from "~/assets/icons/e-book-blue.png";
import basket_white from "~/assets/icons/basket-white.png"; import basket_white from "~/assets/icons/basket-white.png";
const file = (fileId) => `${window.baseURL}file/${fileId}`;
const maxDesktopSize = 1250; const maxDesktopSize = 1250;
const fontSize = { const fontSize = {
@ -31,7 +29,7 @@ function AddToCart(props) {
off, off,
supportItems, supportItems,
page, page,
loading,
info, info,
sampleFileId, sampleFileId,
productType, productType,

@ -4,13 +4,7 @@ import { Link } from "react-router-dom";
import "./index.scss"; import "./index.scss";
function handleClick(event) {
event.preventDefault();
console.info("You clicked a breadcrumb.");
}
const maxDesktopSize = 1250; const maxDesktopSize = 1250;
const maxMobileSize = 650;
const fontSize = { const fontSize = {
desktop: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 90, desktop: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 90,

@ -1,9 +1,8 @@
import React, { Component } from "react"; import React from "react";
import "./index.scss"; import "./index.scss";
const maxDesktopSize = 1250; const maxDesktopSize = 1250;
const maxMobileSize = 550;
const fontSize = { const fontSize = {
desktop: { desktop: {

@ -1,4 +1,4 @@
import React, { Component, useState } from "react"; import React, { useState } from "react";
import MoreHorizIcon from "@material-ui/icons/MoreHoriz"; import MoreHorizIcon from "@material-ui/icons/MoreHoriz";
import Video from "../../QR/VideoBox/React-video-js-player/index"; import Video from "../../QR/VideoBox/React-video-js-player/index";
import Modal from "./Modal/index"; import Modal from "./Modal/index";
@ -8,7 +8,7 @@ export default function Gallery(props) {
const [selectedMedia, setSelectedMedia] = useState(props.gallery[0]); const [selectedMedia, setSelectedMedia] = useState(props.gallery[0]);
const [modal, setModal] = useState(null); const [modal, setModal] = useState(null);
//FIXME: //FIXME:
if (props.gallery[0] != selectedMedia) setSelectedMedia(props.gallery[0]); if (props.gallery[0] !== selectedMedia) setSelectedMedia(props.gallery[0]);
return ( return (
<> <>
{window.innerWidth > 1000 ? ( {window.innerWidth > 1000 ? (

@ -1,28 +1,27 @@
import React, { Component } from 'react'; import React from "react";
import './index.scss'; import "./index.scss";
const maxDesktopSize = 1250; const maxDesktopSize = 1250;
const fontSize = { const fontSize = {
desktop : { desktop: {
h1: window.innerWidth > maxDesktopSize ? 22 : window.innerWidth / 55, h1: window.innerWidth > maxDesktopSize ? 22 : window.innerWidth / 55,
span: window.innerWidth > maxDesktopSize ? 14: window.innerWidth / 80, span: window.innerWidth > maxDesktopSize ? 14 : window.innerWidth / 80,
p: window.innerWidth > maxDesktopSize ? 14 : window.innerWidth / 80, p: window.innerWidth > maxDesktopSize ? 14 : window.innerWidth / 80,
} },
} };
export default function Info(props) { export default function Info(props) {
const {title , subTitle, description} = props; const { title, subTitle, description } = props;
return( return (
<> <>
{ {window.innerWidth > 1000 ? (
window.innerWidth > 1000 ?
<section className="product-info d-flex flex-column"> <section className="product-info d-flex flex-column">
<h1 style={{ fontSize: fontSize.desktop.h1 }}>{title}</h1> <h1 style={{ fontSize: fontSize.desktop.h1 }}>{title}</h1>
<span style={{ fontSize: fontSize.desktop.span }}>{subTitle}</span> <span style={{ fontSize: fontSize.desktop.span }}>{subTitle}</span>
<p style={{ fontSize: fontSize.desktop.p }}>{description}</p> <p style={{ fontSize: fontSize.desktop.p }}>{description}</p>
</section> : null </section>
} ) : null}
</> </>
); );
} }

@ -1,6 +1,6 @@
import React, { useState } from "react"; import React, { useState } from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { comment, book } from "~/Redux/actions"; import { comment } from "~/Redux/actions";
import { makeStyles } from "@material-ui/core/styles"; import { makeStyles } from "@material-ui/core/styles";
import Modal from "@material-ui/core/Modal"; import Modal from "@material-ui/core/Modal";
@ -18,10 +18,6 @@ const fontSize = {
}, },
}; };
function rand() {
return Math.round(Math.random() * 20) - 10;
}
function getModalStyle() { function getModalStyle() {
return { return {
top: `${50}%`, top: `${50}%`,
@ -47,10 +43,12 @@ const useStyles = makeStyles((theme) => ({
function SimpleModal(props) { function SimpleModal(props) {
const classes = useStyles(); const classes = useStyles();
// getModalStyle is not a pure function, we roll the style only on the first render
const [modalStyle] = React.useState(getModalStyle); const [modalStyle] = React.useState(getModalStyle);
const [text, setText] = useState(null); const [text, setText] = useState(null);
//TODO check
const cancle = () => {
props.handleOpenComment(false);
};
const submitComment = () => { const submitComment = () => {
props.addComment({ props.addComment({
userId: props.id, userId: props.id,
@ -87,6 +85,12 @@ function SimpleModal(props) {
> >
ثبت ثبت
</button> </button>
<button
style={{ marginTop: 20, borderRadius: 6, padding: 8 }}
onClick={() => cancle()}
>
انصراف
</button>
</div> </div>
); );
@ -109,5 +113,5 @@ export default connect(
info: state.book.info, info: state.book.info,
id: state.user.status.id, id: state.user.status.id,
}), }),
{ addComment: comment.add, getInfo: book.info } { addComment: comment.add }
)(SimpleModal); )(SimpleModal);

@ -80,7 +80,7 @@ class Product extends Component {
} }
render() { render() {
const { product, supportItems, info, page } = this.props; const { supportItems, info, page } = this.props;
return ( return (
<> <>
{window.innerWidth > 1000 ? ( {window.innerWidth > 1000 ? (
@ -351,10 +351,6 @@ Product.defaultProps = {
], ],
}; };
const Item = (props) => {
return <li style={{ fontSize: fontSize.mobile.li }}>+ {props.item}</li>;
};
const Identifier = (props) => { const Identifier = (props) => {
return ( return (
<> <>

@ -4,13 +4,7 @@ import { Link } from "react-router-dom";
import "./index.scss"; import "./index.scss";
function handleClick(event) {
event.preventDefault();
console.info("You clicked a breadcrumb.");
}
const maxDesktopSize = 1250; const maxDesktopSize = 1250;
const maxMobileSize = 650;
const fontSize = { const fontSize = {
desktop: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 90, desktop: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 90,

@ -3,8 +3,6 @@ import CloseIcon from "@material-ui/icons/Close";
import "./index.scss"; import "./index.scss";
const maxDesktopSize = 1250;
const fontSize = { const fontSize = {
h2: 15, //window.innerWidth > maxDesktopSize ? 13 : window.innerWidth / 85, h2: 15, //window.innerWidth > maxDesktopSize ? 13 : window.innerWidth / 85,
button: 15, //window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 85, button: 15, //window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 85,

@ -4,16 +4,9 @@ import Checkbox from "@material-ui/core/Checkbox";
import CheckBoxOutlineBlankIcon from "@material-ui/icons/CheckBoxOutlineBlank"; import CheckBoxOutlineBlankIcon from "@material-ui/icons/CheckBoxOutlineBlank";
import CheckBoxIcon from "@material-ui/icons/CheckBox"; import CheckBoxIcon from "@material-ui/icons/CheckBox";
import CloseIcon from "@material-ui/icons/Close";
import "./index.scss"; 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 { export default class TypicalFilters extends React.Component {
onChange = (name, data) => { onChange = (name, data) => {
if (name === "subject") { if (name === "subject") {
@ -41,7 +34,7 @@ export default class TypicalFilters extends React.Component {
} }
}; };
render() { render() {
const { data, title, theme, name, parent } = this.props; const { data, title, theme } = this.props;
return ( return (
<div className="products-filters-typical d-flex flex-column"> <div className="products-filters-typical d-flex flex-column">
<header className="products-filters-typical__header d-flex align-items-center"> <header className="products-filters-typical__header d-flex align-items-center">

@ -9,11 +9,11 @@ import "./index.scss";
class List extends React.Component { class List extends React.Component {
componentDidMount() { componentDidMount() {
if (this.props.list.length == 0) this.props.getList(); if (this.props.list.length === 0) this.props.getList();
} }
render() { render() {
let { list, filterResult, loading } = this.props; let { filterResult, loading } = this.props;
return window.innerWidth > 1000 ? ( return window.innerWidth > 1000 ? (
<div className="products-list d-flex flex-wrap"> <div className="products-list d-flex flex-wrap">

@ -27,7 +27,7 @@ const grades = [
class Product extends Component { class Product extends Component {
render() { render() {
const { product, id } = this.props; const { product } = this.props;
return ( return (
<> <>

@ -63,7 +63,7 @@ export default function CustomizedSelects(props) {
: props.parent.setState({ : props.parent.setState({
selectedFilters: { selectedFilters: {
...props.parent.state.selectedFilters, ...props.parent.state.selectedFilters,
[props.name]: props.name === "sort" ? null : new Array(), [props.name]: props.name === "sort" ? null : [],
}, },
}) })
} }

@ -6,7 +6,6 @@ import { Link } from "react-router-dom";
import Navbar from "../Home/Navbar/index"; import Navbar from "../Home/Navbar/index";
import Footer from "../Home/Footer/index"; import Footer from "../Home/Footer/index";
import Select from "./Select/index"; import Select from "./Select/index";
import Product from "./Product/index";
import Breadcrumbs from "./BreadCrumb/index"; import Breadcrumbs from "./BreadCrumb/index";
import List from "./List/index"; import List from "./List/index";
import Sort from "./Sort/index"; import Sort from "./Sort/index";
@ -17,14 +16,6 @@ import navbarSearch from "../../assets/icons/navbarSearch.png";
import "./index.scss"; import "./index.scss";
import { toast } from "react-toastify"; import { toast } from "react-toastify";
const maxMobileSize = 1250;
const fontSize = {
mobile: {
input: window.innerWidth > maxMobileSize ? 14 : window.innerWidth / 27,
},
};
class Products extends Component { class Products extends Component {
state = { state = {
search: null, search: null,

@ -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 MaterialAudioPlayer from "../VoiceBox/Material-audio-player/index";
import "./index.scss"; import "./index.scss";

@ -42,7 +42,7 @@ export default function Modal(props) {
> >
<ChevronRightRoundedIcon style={{ fontSize: 35, color: "white" }} /> <ChevronRightRoundedIcon style={{ fontSize: 35, color: "white" }} />
</div> </div>
<img src={`https://dnvn.ir/api/v1/file/${selectedImage}`} /> <img src={`https://dnvn.ir/api/v1/file/${selectedImage}`} alt="" />
<div <div
className="mobile-qr-image-modal__slide d-flex justify-content-center align-items-center" className="mobile-qr-image-modal__slide d-flex justify-content-center align-items-center"
onClick={() => handleNavigation("left", selectedImage)} onClick={() => handleNavigation("left", selectedImage)}
@ -75,7 +75,7 @@ export default function Modal(props) {
> >
<ChevronRightRoundedIcon style={{ fontSize: 55, color: "white" }} /> <ChevronRightRoundedIcon style={{ fontSize: 55, color: "white" }} />
</div> </div>
<img src={`https://dnvn.ir/api/v1/file/${selectedImage}`} /> <img src={`https://dnvn.ir/api/v1/file/${selectedImage}`} alt="" />
<div <div
className="qr-image-modal__slide d-flex justify-content-center align-items-center" className="qr-image-modal__slide d-flex justify-content-center align-items-center"
onClick={() => handleNavigation("left", selectedImage)} onClick={() => handleNavigation("left", selectedImage)}

@ -1,4 +1,4 @@
import React, { Component, useState } from "react"; import React, { useState } from "react";
import Modal from "./Modal/index"; import Modal from "./Modal/index";
import PhotoLibraryRoundedIcon from "@material-ui/icons/PhotoLibraryRounded"; import PhotoLibraryRoundedIcon from "@material-ui/icons/PhotoLibraryRounded";
@ -46,6 +46,7 @@ export default function QRImage(props) {
// onClick={() => setOpen(true)} // onClick={() => setOpen(true)}
> >
<img <img
alt={list[0]}
className="mobile-qr-image__single" className="mobile-qr-image__single"
src={`https://dnvn.ir/api/v1/file/${list[0]}`} src={`https://dnvn.ir/api/v1/file/${list[0]}`}
onClick={() => setOpen(true)} onClick={() => setOpen(true)}
@ -59,11 +60,13 @@ export default function QRImage(props) {
// onClick={() => setOpen(true)} // onClick={() => setOpen(true)}
> >
<img <img
alt={list[0]}
className="mobile-qr-image__two" className="mobile-qr-image__two"
src={`https://dnvn.ir/api/v1/file/${list[0]}`} src={`https://dnvn.ir/api/v1/file/${list[0]}`}
onClick={() => setOpen(true)} onClick={() => setOpen(true)}
/> />
<img <img
alt={list[1]}
className="mobile-qr-image__two" className="mobile-qr-image__two"
src={`https://dnvn.ir/api/v1/file/${list[1]}`} src={`https://dnvn.ir/api/v1/file/${list[1]}`}
onClick={() => setOpen(true)} onClick={() => setOpen(true)}
@ -75,6 +78,7 @@ export default function QRImage(props) {
<div className="mobile-qr-image d-flex"> <div className="mobile-qr-image d-flex">
<div className="mobile-qr-image__two mobile-qr-image__more"> <div className="mobile-qr-image__two mobile-qr-image__more">
<img <img
alt={list[0]}
src={`https://dnvn.ir/api/v1/file/${list[0]}`} src={`https://dnvn.ir/api/v1/file/${list[0]}`}
onClick={() => setOpen(true)} onClick={() => setOpen(true)}
/> />
@ -88,6 +92,7 @@ export default function QRImage(props) {
+{list.length - 2} +{list.length - 2}
</span> </span>
<img <img
alt={list[1]}
className="mobile-qr-image__two" className="mobile-qr-image__two"
src={`https://dnvn.ir/api/v1/file/${list[1]}`} src={`https://dnvn.ir/api/v1/file/${list[1]}`}
/> />
@ -112,6 +117,7 @@ export default function QRImage(props) {
// onClick={() => setOpen(true)} // onClick={() => setOpen(true)}
> >
<img <img
alt={list[0]}
className="qr-image__single" className="qr-image__single"
src={`https://dnvn.ir/api/v1/file/${list[0]}`} src={`https://dnvn.ir/api/v1/file/${list[0]}`}
onClick={() => setOpen(true)} onClick={() => setOpen(true)}
@ -125,11 +131,13 @@ export default function QRImage(props) {
// onClick={() => setOpen(true)} // onClick={() => setOpen(true)}
> >
<img <img
alt={list[0]}
className="qr-image__two" className="qr-image__two"
src={`https://dnvn.ir/api/v1/file/${list[0]}`} src={`https://dnvn.ir/api/v1/file/${list[0]}`}
onClick={() => setOpen(true)} onClick={() => setOpen(true)}
/> />
<img <img
alt={list[1]}
className="qr-image__two" className="qr-image__two"
src={`https://dnvn.ir/api/v1/file/${list[1]}`} src={`https://dnvn.ir/api/v1/file/${list[1]}`}
onClick={() => setOpen(true)} onClick={() => setOpen(true)}
@ -143,16 +151,19 @@ export default function QRImage(props) {
// onClick={() => setOpen(true)} // onClick={() => setOpen(true)}
> >
<img <img
alt={list[0]}
className="qr-image__three" className="qr-image__three"
src={`https://dnvn.ir/api/v1/file/${list[0]}`} src={`https://dnvn.ir/api/v1/file/${list[0]}`}
onClick={() => setOpen(true)} onClick={() => setOpen(true)}
/> />
<img <img
alt={list[1]}
className="qr-image__three" className="qr-image__three"
src={`https://dnvn.ir/api/v1/file/${list[1]}`} src={`https://dnvn.ir/api/v1/file/${list[1]}`}
onClick={() => setOpen(true)} onClick={() => setOpen(true)}
/> />
<img <img
alt={list[2]}
className="qr-image__three" className="qr-image__three"
src={`https://dnvn.ir/api/v1/file/${list[2]}`} src={`https://dnvn.ir/api/v1/file/${list[2]}`}
onClick={() => setOpen(true)} onClick={() => setOpen(true)}
@ -164,12 +175,14 @@ export default function QRImage(props) {
<div className="qr-image d-flex"> <div className="qr-image d-flex">
<div className="qr-image__three qr-image__more"> <div className="qr-image__three qr-image__more">
<img <img
alt={list[0]}
src={`https://dnvn.ir/api/v1/file/${list[0]}`} src={`https://dnvn.ir/api/v1/file/${list[0]}`}
onClick={() => setOpen(true)} onClick={() => setOpen(true)}
/> />
</div> </div>
<div className="qr-image__three qr-image__more"> <div className="qr-image__three qr-image__more">
<img <img
alt={list[1]}
src={`https://dnvn.ir/api/v1/file/${list[1]}`} src={`https://dnvn.ir/api/v1/file/${list[1]}`}
onClick={() => setOpen(true)} onClick={() => setOpen(true)}
/> />
@ -182,7 +195,7 @@ export default function QRImage(props) {
> >
+{list.length - 3} +{list.length - 3}
</span> </span>
<img src={`https://dnvn.ir/api/v1/file/${list[2]}`} /> <img alt={list[2]} src={`https://dnvn.ir/api/v1/file/${list[2]}`} />
</div> </div>
{open ? ( {open ? (
<Modal <Modal

@ -2,7 +2,6 @@ import React from "react";
import "./index.scss"; import "./index.scss";
const maxDesktopSize = 1250;
const maxMobileSize = 550; const maxMobileSize = 550;
const fontSize = { const fontSize = {

@ -1,9 +1,7 @@
import React, { Component, useState } from "react"; import React, { useState } from "react";
import KeyboardArrowUpIcon from "@material-ui/icons/KeyboardArrowUp"; import KeyboardArrowUpIcon from "@material-ui/icons/KeyboardArrowUp";
import KeyboardArrowDownIcon from "@material-ui/icons/KeyboardArrowDown"; import KeyboardArrowDownIcon from "@material-ui/icons/KeyboardArrowDown";
import navbarSearch from "../../../assets/icons/navbarSearch.png"; import navbarSearch from "../../../assets/icons/navbarSearch.png";
import "./index.scss"; import "./index.scss";
const maxDesktopSize = 1250; const maxDesktopSize = 1250;
@ -22,7 +20,9 @@ export default function Dropdown(props) {
const [search, setSearch] = useState(""); const [search, setSearch] = useState("");
const handleSearch = (val) => { const handleSearch = (val) => {
let fakeList = props.subjects.filter((item) => item.name.search(val) !== -1); let fakeList = props.subjects.filter(
(item) => item.name.search(val) !== -1
);
setSearchedSubjects(fakeList); setSearchedSubjects(fakeList);
setSearch(val); setSearch(val);
}; };
@ -50,7 +50,11 @@ export default function Dropdown(props) {
{dropdown ? ( {dropdown ? (
<> <>
<div className="subjects-dropdown__search d-flex"> <div className="subjects-dropdown__search d-flex">
<input type="search" style={{ fontSize: fontSize.desktop.input }} onChange={(e) => handleSearch(e.target.value)} /> <input
type="search"
style={{ fontSize: fontSize.desktop.input }}
onChange={(e) => handleSearch(e.target.value)}
/>
<img src={navbarSearch} alt="جستجو" /> <img src={navbarSearch} alt="جستجو" />
</div> </div>
<ul> <ul>

@ -1,6 +1,4 @@
import React, { Component } from "react"; import React, { Component } from "react";
import VideoPlayer from "react-video-js-player";
import film from "../../../../assets/Video/film.mp4";
import "./index.scss"; import "./index.scss";
class VideoApp extends Component { class VideoApp extends Component {

@ -1,5 +1,4 @@
import React from "react"; import React from "react";
import { VideoCard } from "material-ui-player";
import ReactVideoJsPlayer from "./React-video-js-player/index"; import ReactVideoJsPlayer from "./React-video-js-player/index";
import PlayCircleFilledRoundedIcon from "@material-ui/icons/PlayCircleFilledRounded"; import PlayCircleFilledRoundedIcon from "@material-ui/icons/PlayCircleFilledRounded";

@ -1,3 +1,4 @@
/* eslint-disable jsx-a11y/anchor-has-content */
import React, { Component } from "react"; import React, { Component } from "react";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import Navbar from "../Home/Navbar/index"; import Navbar from "../Home/Navbar/index";
@ -9,9 +10,7 @@ import VideoBox from "./VideoBox/index";
import PDF from "./PDF/index"; import PDF from "./PDF/index";
import PowerPoint from "./PowerPoint/index"; import PowerPoint from "./PowerPoint/index";
import Links from "./Links/index"; import Links from "./Links/index";
import SubjectsDropdown from "./SubjectsDropdown/index";
import BookContent from "./BookContent/index"; import BookContent from "./BookContent/index";
import NightsStayOutlinedIcon from "@material-ui/icons/NightsStayOutlined";
import MoreVertIcon from "@material-ui/icons/MoreVert"; import MoreVertIcon from "@material-ui/icons/MoreVert";
import { connect } from "react-redux"; import { connect } from "react-redux";
@ -90,7 +89,7 @@ class QR extends Component {
} }
render() { render() {
const { QR, qrList, loading } = this.props; const { qrList, loading } = this.props;
const fontSize = { const fontSize = {
desktop: { desktop: {
sidebar: { sidebar: {

@ -1,4 +1,4 @@
import React, { Component } from "react"; import React from "react";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import "./index.scss"; import "./index.scss";

@ -1,7 +1,6 @@
import React, { Component } from "react"; import React, { Component } from "react";
import Navbar from "../Home/Navbar/index"; import Navbar from "../Home/Navbar/index";
import Footer from "../Home/Footer/index"; import Footer from "../Home/Footer/index";
import { Link } from "react-router-dom";
import Scanner from "./Scanner/index"; import Scanner from "./Scanner/index";
import LastQr from "./LastQr/index"; import LastQr from "./LastQr/index";

@ -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 ? (
<div className="support__document d-flex justify-content-center align-items-center mb-3">
<input
type="file"
name={name}
onChange={(e) =>
parent.onChange(e.target.name, e.target.files[0], "file")
}
/>
{parent.state.file ? (
<span
style={{
fontSize: fontSize.mobile.span,
width: "100%",
textAlign: "center",
margin: "auto",
}}
>
{parent.state.file?.name || "تصویر بارگزاری شد"}
</span>
) : (
<span style={{ fontSize: fontSize.mobile.span }}>
در صورت نیاز تصویر مرتبط را انتخاب کنید.
</span>
)}
</div>
) : null}
{window.innerWidth > 1000 ? (
<div className="support__document d-flex justify-content-center-align-items-center">
<input
type="file"
name={name}
onChange={(e) =>
parent.onChange(e.target.name, e.target.files[0], "file")
}
/>{" "}
{parent.state.file ? (
<span
style={{
fontSize: fontSize.mobile.span,
width: "100%",
textAlign: "center",
margin: "auto",
}}
>
{parent.state.file?.name || "فایل ثبت شد"}
</span>
) : (
<span
style={{
fontSize: fontSize.mobile.span,
width: "100%",
textAlign: "center",
margin: "auto",
}}
>
در صورت نیاز تصویر مرتبط را انتخاب کنید.
</span>
)}
</div>
) : null}
</>
);
}

@ -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;
}
}
}

@ -1,11 +1,12 @@
import React, { Component } from "react"; import React, { Component } from "react";
import { userProduct } from "~/Redux/actions"; import { userProduct, comment, file } from "~/Redux/actions";
import Navbar from "../Home/Navbar/index"; import Navbar from "../Home/Navbar/index";
import Input from "../Contact/Input/index"; import Input from "../Contact/Input/index";
import Select from "../Contact/Select/index"; import Select from "../Contact/Select/index";
import Upload from "./Upload";
import "../Contact/index.scss"; import "./index.scss";
import { connect } from "react-redux"; import { connect } from "react-redux";
const maxDesktopSize = 1250; const maxDesktopSize = 1250;
@ -29,48 +30,94 @@ class Support extends Component {
name: null, name: null,
cellphone: null, cellphone: null,
unit: null, unit: null,
book: null, bookId: null,
subject: null, subject: null,
text: null, text: null,
file: null,
fileId: null,
}; };
componentDidMount() { componentDidMount() {
console.log(this.props); if (!this.props.myProductList) this.props.getUserProductList({});
// this.props?.getList(); }
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() { render() {
let { status } = this.props;
return ( return (
<> <>
<div className="mobile-contact d-flex flex-column align-items-center"> <div className="mobile-support d-flex flex-column align-items-center">
<Navbar page={"contact"} /> <Navbar page={"support"} />
<div className="mobile-contact__form d-flex flex-column"> <div className="mobile-support__form d-flex flex-column">
<h1 style={{ fontSize: fontSize.mobile.h1 }}>پشتیبانی</h1> <h1 style={{ fontSize: fontSize.mobile.h1 }}>پشتیبانی</h1>
{/* <Input label={"نام و نام خانوادگی"} name={"name"} parent={this} /> {status ? null : (
<Input label={"شماره تماس"} name={"cellphone"} parent={this} /> */} <>
<Input
label={"نام و نام خانوادگی"}
name={"name"}
parent={this}
/>
<Input label={"شماره تماس"} name={"cellphone"} parent={this} />
</>
)}
<Select <Select
name="unit" name="unit"
options={[ options={
"واحد مورد نظر", status
"واحد فروش", ? ["واحد مورد نظر", "واحد فروش", "واحد محتوایی", "واحد فنی"]
"واحد محتوایی", : ["واحد مورد نظر", "واحد فروش", "واحد فنی"]
"واحد فنی", }
]}
parent={this} parent={this}
/> />
{this.state.unit === "واحد محتوایی" ? ( {this.state.unit === "واحد محتوایی" ? (
<Select <Select
name="book" name="bookId"
options={[ options={[
"کتاب",
...new Set( ...new Set(
this.props.list?.map((item) => item.product.book.name) || [] this.props.myProductList?.map(
(item) => item.product.book.name
) || []
), ),
]} ]}
parent={this} parent={this}
/> />
) : null} ) : null}
<Input label={"موضوع پیام"} name={"subject"} parent={this} /> <Input label={"موضوع "} name={"subject"} parent={this} />
<textarea placeholder="متن پیام" name="text" rows="8"></textarea> <Input label={"متن"} name={"text"} parent={this} multiline />
<button>ارسال</button> {/* <textarea placeholder="متن " name="text" rows="8" o></textarea> */}
<Upload
type="file"
onChange={(e) => this.addFile(e)}
parent={this}
name="file"
/>
<button onClick={() => this.send()}>ارسال</button>
</div> </div>
</div> </div>
</> </>
@ -80,7 +127,13 @@ class Support extends Component {
export default connect( export default connect(
(state) => ({ (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); )(Support);

@ -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);
}
}
}
}
Loading…
Cancel
Save