From 79f9f8d91a595b2e6fc41c33f0bcc9ecdf75c777 Mon Sep 17 00:00:00 2001 From: mahdi Date: Sat, 14 May 2022 15:34:31 +0430 Subject: [PATCH] update data.js --- .../ProductTable1/index.js | 111 ++++++++++++++++++ .../ProductDescriptionTable/index.js | 25 ++++ src/redux/data.js | 11 ++ 3 files changed, 147 insertions(+) create mode 100644 src/components/ProductDescriptionTable/ProductTable1/index.js create mode 100644 src/components/ProductDescriptionTable/index.js diff --git a/src/components/ProductDescriptionTable/ProductTable1/index.js b/src/components/ProductDescriptionTable/ProductTable1/index.js new file mode 100644 index 0000000..58510ac --- /dev/null +++ b/src/components/ProductDescriptionTable/ProductTable1/index.js @@ -0,0 +1,111 @@ +import React from "react"; + +const ProductTable1 = ({ navTitles, items, addToCart }) => { + return ( + <> +
+ +
+
+
+ {items.map((e) => + e.items.map((item) => ( +
    +
  • + {item.title} +
  • +
  • + {item.description} +
  • +
+ )) + )} +
+
{addToCart}
+
+ + ); +}; + +export default ProductTable1; + +ProductTable1.defaultProps = { + navTitles: [ + { + id: 0, + title: "مشخصات", + isActive: true, + name: "moshakhasat", + }, + { + id: 1, + title: "نقد و بررسی", + isActive: false, + }, + { + id: 2, + title: "برسش و باسخ", + isActive: false, + }, + ], + + items: [ + { + name: "moshakhasat", + items: [ + { + title: "وزن کتاب", + description: "۱ کیلوگرم", + }, + { + title: "تعداد صفحات", + description: "400 صفحه", + }, + { + title: "نوع کاغذ", + description: "گلاسه", + }, + { + title: "شماره شابک", + description: "1225548218000005818765", + }, + { + title: "انتشارات", + description: "رزمندگان", + }, + { + title: "نویسنده و یا معلف", + description: "یک نویسنده گمنام", + }, + { + title: "قطع", + description: "خشتی", + }, + { + title: "سال انتشار", + description: "1399", + }, + ], + }, + ], +}; diff --git a/src/components/ProductDescriptionTable/index.js b/src/components/ProductDescriptionTable/index.js new file mode 100644 index 0000000..4ea5a60 --- /dev/null +++ b/src/components/ProductDescriptionTable/index.js @@ -0,0 +1,25 @@ +import React, { useState } from "react"; + +import ProductTable1 from "./ProductTable1"; + +function Advertisements() { + const list = { + 1: , + }; + const [type, setType] = useState(1); + return ( +
+ + {list[type]} +
+ ); +} + +export default Advertisements; diff --git a/src/redux/data.js b/src/redux/data.js index 0037e94..1cb2ebc 100644 --- a/src/redux/data.js +++ b/src/redux/data.js @@ -26,6 +26,7 @@ import SingleProduct from "../components/SingleProduct"; import Rating from "../components/Rating"; import Tooltip from "../components/Tooltip"; import ProductSuggestionCard from "../components/ProductSuggestionCard"; +import ProductDescriptionTable from "../components/ProductDescriptionTable"; // mini components import MiniComponents from "../components/MiniComponents"; @@ -599,6 +600,16 @@ const components = [ code: null, }, }, + { + name: "Product Description Table", + author: "Keshavarzi", + props: [], + content: { + name: "Product Description Table", + component: , + code: null, + }, + }, // mini components { name: "Mini Components",