From abd56f9e06ece7e9e504bd412299235bbbe7a255 Mon Sep 17 00:00:00 2001 From: amir hosein gorji Date: Wed, 3 Nov 2021 01:04:14 +0330 Subject: [PATCH] update 9 files --- config/webpack.config.js | 6 ++++- package.json | 3 ++- src/views/Home/HomeSlider/index.js | 1 + src/views/Home/Navbar/Laptop/index.js | 2 +- src/views/Home/index.js | 1 + .../VideoBox/React-video-js-player/index.js | 2 +- .../VoiceBox/Material-audio-player/index.js | 2 +- src/views/QR/index.js | 9 +++++-- yarn.lock | 26 ++++++++++++++++++- 9 files changed, 44 insertions(+), 8 deletions(-) diff --git a/config/webpack.config.js b/config/webpack.config.js index 2512345..19d14e1 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -30,9 +30,10 @@ const ReactRefreshWebpackPlugin = require("@pmmmwh/react-refresh-webpack-plugin" const postcssNormalize = require("postcss-normalize"); const appPackageJson = require(paths.appPackageJson); +// const CompressionPlugin = require("compression-webpack-plugin"); // Source maps are resource heavy and can cause out of memory issue for large source files. -const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== "false"; +const shouldUseSourceMap = false; //process.env.GENERATE_SOURCEMAP !== "false"; const webpackDevClientEntry = require.resolve( "react-dev-utils/webpackHotDevClient" @@ -345,6 +346,9 @@ module.exports = function (webpackEnv) { // To fix this, we prevent you from importing files out of src/ -- if you'd like to, // please link the files into your node_modules/ and let module-resolution kick in. // Make sure your source files are compiled, as they will not be processed in any way. + // new CompressionPlugin({ + // test: /\.js(\?.*)?$/i, + // }), new ModuleScopePlugin(paths.appSrc, [ paths.appPackageJson, reactRefreshOverlayEntry, diff --git a/package.json b/package.json index df2ed6a..ddd1f09 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "bootstrap": "^5.0.1", "camelcase": "^6.1.0", "case-sensitive-paths-webpack-plugin": "2.3.0", + "compression-webpack-plugin": "^9.0.0", "create-index": "^2.6.0", "css-loader": "4.3.0", "dotenv": "8.2.0", @@ -198,4 +199,4 @@ ] ] } -} \ No newline at end of file +} diff --git a/src/views/Home/HomeSlider/index.js b/src/views/Home/HomeSlider/index.js index fcbaf1b..f7466e9 100644 --- a/src/views/Home/HomeSlider/index.js +++ b/src/views/Home/HomeSlider/index.js @@ -19,6 +19,7 @@ const fontSize = { }; const SimpleHeader = (props) => { + console.log("Simple Header", props.link); return ( <> {window.innerWidth > 1000 ? ( diff --git a/src/views/Home/Navbar/Laptop/index.js b/src/views/Home/Navbar/Laptop/index.js index e85ff81..46c6b2c 100644 --- a/src/views/Home/Navbar/Laptop/index.js +++ b/src/views/Home/Navbar/Laptop/index.js @@ -108,7 +108,7 @@ class LaptopNavbar extends Component { vertical: "bottom", horizontal: "center", }} - open={this.state.dropdown} + open={this.state.dropdown || false} onClose={() => this.setState({ dropdown: false })} > this.setState({ dropdown: false })}> diff --git a/src/views/Home/index.js b/src/views/Home/index.js index 90164b2..2c8da40 100644 --- a/src/views/Home/index.js +++ b/src/views/Home/index.js @@ -91,6 +91,7 @@ class Home extends Component { } > + {homeData.map((item, i) => ( ))} diff --git a/src/views/QR/VideoBox/React-video-js-player/index.js b/src/views/QR/VideoBox/React-video-js-player/index.js index 3963fa4..b1b4d75 100644 --- a/src/views/QR/VideoBox/React-video-js-player/index.js +++ b/src/views/QR/VideoBox/React-video-js-player/index.js @@ -39,7 +39,7 @@ class VideoApp extends Component { height="100%" width={"100%"} type="video/mp4" - autoplay={true} + autoPlay={true} url={this.state.video.src} controls playing diff --git a/src/views/QR/VoiceBox/Material-audio-player/index.js b/src/views/QR/VoiceBox/Material-audio-player/index.js index 37e7957..e0745ba 100644 --- a/src/views/QR/VoiceBox/Material-audio-player/index.js +++ b/src/views/QR/VoiceBox/Material-audio-player/index.js @@ -12,7 +12,7 @@ export default function MaterialAudioPlayer(props) { variation="default" spacing={3} // download={true} - autoplay={false} + autoPlay={false} order="standart" preload="auto" loop={false} diff --git a/src/views/QR/index.js b/src/views/QR/index.js index 5ae15a0..e9bbcf9 100644 --- a/src/views/QR/index.js +++ b/src/views/QR/index.js @@ -18,9 +18,13 @@ import { qr } from "~/Redux/actions"; import exit from "../../assets/icons/exit.svg"; import sciense_7 from "../../assets/images/sciense-7.png"; +import { useHistory } from "react-router-dom"; import "./index.scss"; - +function Navigate({ path }) { + let history = useHistory(); + return <>{history.push(path)}; +} const maxDesktopSize = 1250; const grades = [ "اول", @@ -74,7 +78,7 @@ class QR extends Component { componentDidUpdate(prevProps, prevState) { const { qrList } = this.props; - if (prevProps.qrList !== qrList) { + if (prevProps.qrList !== qrList && !qrList.activationCode) { localStorage.setItem( "latestQr", JSON.stringify({ @@ -114,6 +118,7 @@ class QR extends Component { }, }, }; + if (+qrList?.activationCode === 1) return ; return ( <> diff --git a/yarn.lock b/yarn.lock index c8040ad..afe6d37 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2359,7 +2359,7 @@ jest-diff "^26.0.0" pretty-format "^26.0.0" -"@types/json-schema@*", "@types/json-schema@^7.0.3", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.6", "@types/json-schema@^7.0.7": +"@types/json-schema@*", "@types/json-schema@^7.0.3", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.6", "@types/json-schema@^7.0.7", "@types/json-schema@^7.0.8": version "7.0.9" resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz" integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ== @@ -4541,6 +4541,14 @@ compressible@~2.0.16: dependencies: mime-db ">= 1.43.0 < 2" +compression-webpack-plugin@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/compression-webpack-plugin/-/compression-webpack-plugin-9.0.0.tgz#38b4e18313f5d704c453ab5645e38a5805ba5889" + integrity sha512-V2KmQqaUkErPT+ZcUGHa8zWpIw1oTYaC7wjGewJm053GWAoY04GfU5B/NZ/JSz1eFp9MggMdLQpEHe1TJAQY1A== + dependencies: + schema-utils "^3.1.0" + serialize-javascript "^6.0.0" + compression@^1.7.4: version "1.7.4" resolved "https://registry.npmjs.org/compression/-/compression-1.7.4.tgz" @@ -11869,6 +11877,15 @@ schema-utils@^3.0.0: ajv "^6.12.5" ajv-keywords "^3.5.2" +schema-utils@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.1.1.tgz#bc74c4b6b6995c1d88f76a8b77bea7219e0c8281" + integrity sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw== + dependencies: + "@types/json-schema" "^7.0.8" + ajv "^6.12.5" + ajv-keywords "^3.5.2" + sdp@^2.12.0, sdp@^2.6.0: version "2.12.0" resolved "https://registry.npmjs.org/sdp/-/sdp-2.12.0.tgz" @@ -11946,6 +11963,13 @@ serialize-javascript@^5.0.1: dependencies: randombytes "^2.1.0" +serialize-javascript@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" + integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== + dependencies: + randombytes "^2.1.0" + serve-index@^1.9.1: version "1.9.1" resolved "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz"