import React, { Component } from "react"; import Navbar from "../Home/Navbar/index"; import Footer from "../Home/Footer/index"; import Scanner from "./Scanner/index"; import LastQr from "./LastQr/index"; import Modal from "./Modal/index"; import ReplayIcon from "@material-ui/icons/Replay"; import FlipCameraIosIcon from "@material-ui/icons/FlipCameraIos"; import { connect } from "react-redux"; import { qr, userProduct } from "~/Redux/actions"; import sciense_6 from "../../assets/images/sciense-6.png"; import "./index.scss"; const maxDesktopSize = 1250; const fontSize = { desktop: { h1: window.innerWidth > maxDesktopSize ? 25 : window.innerWidth / 70, p: window.innerHeight > maxDesktopSize ? 15 : window.innerWidth / 90, }, }; class QRScan extends Component { state = { value: null, facingMode: 0, tail: null, //"Zist10-146", }; componentDidMount() { console.log(this.props.myList); if (!this.props.myList) this.props.getMyList({}); } async componentDidUpdate() { if (this.state.value) { let tail = this.state.value.slice( this.state.value.lastIndexOf("/") + 1, this.state.value.length ); // if (tail.length) this.props.info({ tail: tail }); this.setState({ value: null, tail: tail }); } } render() { const { data } = this.props; return ( <> {window.innerWidth > 1000 ? ( <>

{window.t("نکته")}

{window.t( "لطفا دوربین خود را روی کدی که در اختیار شما قرار گرفته قرار" )} {window.t("دهید تا اسکن دوربین انجام شود")}{" "}

{this.state.value !== null ? (
this.setState({ value: null })} >
) : this.state.tail === null ? ( ) : null}
{this.state.tail === null ? null : ( )}