From 13345793e6306d37284c90fcdb3bc26458f1c26e Mon Sep 17 00:00:00 2001 From: RezaAshrafi77 Date: Tue, 17 Aug 2021 16:30:20 +0430 Subject: [PATCH] Reza fixed product and cart desktop and mobile version --- src/Redux/actions/public.js | 2 + src/Redux/reducers/public.js | 3 + src/views/AR/Item/index.js | 5 +- src/views/AR/index.js | 105 +++++++++++++--------------- src/views/Cart/Table/index.scss | 120 +++++++++++++++++--------------- src/views/Cart/index.js | 5 +- src/views/Product/index.js | 63 +++++++++++------ src/views/Product/index.scss | 20 ++++-- 8 files changed, 182 insertions(+), 141 deletions(-) diff --git a/src/Redux/actions/public.js b/src/Redux/actions/public.js index 61eec87..3ade7e8 100644 --- a/src/Redux/actions/public.js +++ b/src/Redux/actions/public.js @@ -12,6 +12,8 @@ const publicApi = { (data = {}, history) => async (dispatch) => await proxy.get("public/contact", data, { history, dispatch }), + getArList: (data, history) => async (dispatch) => + await proxy.get("public/ar", data, { history, dispatch }), }; export default publicApi; diff --git a/src/Redux/reducers/public.js b/src/Redux/reducers/public.js index 600b457..fdccc5a 100644 --- a/src/Redux/reducers/public.js +++ b/src/Redux/reducers/public.js @@ -5,6 +5,7 @@ const initialState = { error: null, searchResult: [], contactData: null, + arList: [], }; export default function publicApi(state = initialState, action) { let { type, data } = action; @@ -38,6 +39,8 @@ export default function publicApi(state = initialState, action) { }; case "public/contact": return { ...state, loading: false, error: null, contactData: data }; + case "public/ar": + return { ...state, loading: false, error: null, arList: data }; case "loading": return { ...state, loading: true }; case "error": diff --git a/src/views/AR/Item/index.js b/src/views/AR/Item/index.js index e4f597b..0238297 100644 --- a/src/views/AR/Item/index.js +++ b/src/views/AR/Item/index.js @@ -26,7 +26,10 @@ export default class Item extends Component { {window.innerWidth < 1000 ? (
- {data.title} + {data.title}

{data.title}

diff --git a/src/views/AR/index.js b/src/views/AR/index.js index b518e8d..8a88bfc 100644 --- a/src/views/AR/index.js +++ b/src/views/AR/index.js @@ -1,15 +1,12 @@ import React, { Component } from "react"; +import { connect } from "react-redux"; +import { publicApi } from "~/Redux/actions"; + import Navbar from "../Home/Navbar/index"; import Footer from "../Home/Footer/index"; +import Loader from "~/components/Loader/index"; import Item from "./Item/index"; -import zist_10 from "~/assets/images/zist-10.png"; -import chemistry_10 from "~/assets/images/chemistry-10.png"; -import sciense_8 from "~/assets/images/sciense-8.png"; -import sciense_7 from "~/assets/images/sciense-7.png"; -import sciense_6 from "~/assets/images/sciense-6.png"; -import sciense_9 from "~/assets/images/sciense-9.png"; - import "./index.scss"; const maxDesktopSize = 1250; @@ -21,66 +18,62 @@ const fontSize = { }, }; -export default class AR extends Component { +class AR extends Component { + componentDidMount() { + this.props.getArList(); + } + render() { - const { data } = this.props; + const { data, arList } = this.props; return ( <> {window.innerWidth > 1000 ? ( - <> -
- -
+ arList ? ( + <> +
+ +
+
+