From 069093b7745d590a928159b52500a0d6671c03ba Mon Sep 17 00:00:00 2001 From: mahdi Date: Sat, 21 May 2022 12:13:56 +0430 Subject: [PATCH] delete 3 files and update 2 files --- .../images/ProductImageproduct-chair.svg | 0 .../images/ProductImageproductImg.svg | 0 .../ProductGallery/ProductImage/index.js | 58 +++++++++++++++++ src/components/ProductGallery/index.js | 25 ++++++++ src/components/ProductImage/index.js | 63 ------------------- src/components/Tabels/ReactTable4/index.js | 6 -- src/redux/data.js | 11 ++++ 7 files changed, 94 insertions(+), 69 deletions(-) rename src/components/ProductImage/product-chair.svg => public/images/ProductImageproduct-chair.svg (100%) rename src/components/ProductImage/productImg.svg => public/images/ProductImageproductImg.svg (100%) create mode 100644 src/components/ProductGallery/ProductImage/index.js create mode 100644 src/components/ProductGallery/index.js delete mode 100644 src/components/ProductImage/index.js diff --git a/src/components/ProductImage/product-chair.svg b/public/images/ProductImageproduct-chair.svg similarity index 100% rename from src/components/ProductImage/product-chair.svg rename to public/images/ProductImageproduct-chair.svg diff --git a/src/components/ProductImage/productImg.svg b/public/images/ProductImageproductImg.svg similarity index 100% rename from src/components/ProductImage/productImg.svg rename to public/images/ProductImageproductImg.svg diff --git a/src/components/ProductGallery/ProductImage/index.js b/src/components/ProductGallery/ProductImage/index.js new file mode 100644 index 0000000..fb8b817 --- /dev/null +++ b/src/components/ProductGallery/ProductImage/index.js @@ -0,0 +1,58 @@ +// it has style inside index.scss ---> // Start ProductImage && end ProductImage + +import React from "react"; + +const ProductImage = ({ images }) => { + console.log(images.length); + + return ( +
+
+ {images.slice(0, 4).map((image, index) => ( +
+ + {/* این خط پایین که نوشتم برای این است که ایندکس که جنسش استرینگ است رو به نامبر تبدیل کند */} + {Number(index) === 3 && ( +
+ + {images.length - 3} +
+ )} +
+ ))} +
+ +
+ ); +}; +// {[0, 1, 2, 3, 4].map((item, index) => ( + +// ))} + +export default ProductImage; + +ProductImage.defaultProps = { + images: [ + { + image: "images/ProductImageproductImg.svg", + }, + { + image: "images/ProductImageproductImg.svg", + }, + { + image: "images/ProductImageproductImg.svg", + }, + { + image: "images/ProductImageproductImg.svg", + }, + { + image: "images/ProductImageproductImg.svg", + }, + ], +}; diff --git a/src/components/ProductGallery/index.js b/src/components/ProductGallery/index.js new file mode 100644 index 0000000..2cd3eb5 --- /dev/null +++ b/src/components/ProductGallery/index.js @@ -0,0 +1,25 @@ +import React, { useState } from "react"; + +import ProductImage from "./ProductImage"; + +function ProductGallery() { + const list = { + 1: , + }; + const [type, setType] = useState(1); + return ( +
+ + {list[type]} +
+ ); +} + +export default ProductGallery; diff --git a/src/components/ProductImage/index.js b/src/components/ProductImage/index.js deleted file mode 100644 index 6255d01..0000000 --- a/src/components/ProductImage/index.js +++ /dev/null @@ -1,63 +0,0 @@ -// it has style inside index.scss ---> // Start ProductImage && end ProductImage - -import React from "react"; - - -import productImg from "./productImg.svg"; - -const ProductImage = ({ images }) => { - console.log(images.length); - - return ( -
-
-
- {images.slice(0, 4).map((image, index) => ( -
- - {/* این خط پایین که نوشتم برای این است که ایندکس که جنسش استرینگ است رو به نامبر تبدیل کند */} - {Number(index) === 3 && ( -
- + {images.length - 3} -
- )} -
- ))} -
- -
-
- ); -}; -// {[0, 1, 2, 3, 4].map((item, index) => ( - -// ))} - -export default ProductImage; - -ProductImage.defaultProps = { - images: [ - { - image: productImg, - }, - { - image: productImg, - }, - { - image: productImg, - }, - { - image: productImg, - }, - { - image: productImg, - }, - ], -}; diff --git a/src/components/Tabels/ReactTable4/index.js b/src/components/Tabels/ReactTable4/index.js index b727a25..507038b 100644 --- a/src/components/Tabels/ReactTable4/index.js +++ b/src/components/Tabels/ReactTable4/index.js @@ -32,12 +32,6 @@ const ReactTable4 = ({ breadCrumbs }) => { return (
- {/* breadCrumb */} -
- - {console.log("mahdi")} - {console.log(BreadCrumb)} -
diff --git a/src/redux/data.js b/src/redux/data.js index 23ccfa4..f77b6cd 100644 --- a/src/redux/data.js +++ b/src/redux/data.js @@ -46,6 +46,7 @@ import FileManager from "../components/FileManager"; import FormFields from "../components/FormFields"; import Tabels from "../components/Tabels"; import LeafletMap from "../components/LeafletMap"; +import ProductGallery from "../components/ProductGallery"; // mini components import MiniComponents from "../components/MiniComponents"; @@ -819,6 +820,16 @@ const components = [ code: null, }, }, + { + name: "Product Gallery", + author: "Andalib", + props: [], + content: { + name: "Product Gallery", + component: , + code: null, + }, + }, // mini components { name: "Mini Components",