diff --git a/src/components/ProductDescription/index.js b/src/components/ProductDescription/index.js index aa11d56..7ab7eb4 100644 --- a/src/components/ProductDescription/index.js +++ b/src/components/ProductDescription/index.js @@ -1,32 +1,49 @@ + import React from "react"; +import { useState } from "react"; const ProductDescription = ({ navTitles, items, addToCart }) =>{ + const [name, setName] = useState(navTitles[0].name); + const [type, setType] = useState([]); return( <>
- {items.map(e => ( - + + {items.map(e => ( + e.name == name ? e.items.map(item => ( - )) + + )) : null ))} @@ -60,7 +77,8 @@ ProductDescription.defaultProps = { { id: 1, title: 'نقد و بررسی', - isActive: false + isActive: false, + name: 'review' }, { id: 2, @@ -105,6 +123,12 @@ ProductDescription.defaultProps = { description: '1399' }, ] + }, + { + name: 'review', + items: [{ + description: 'لورم ایبسوم' + }] } ]