diff --git a/src/App.scss b/src/App.scss index a6a3350..e4d22ee 100644 --- a/src/App.scss +++ b/src/App.scss @@ -32,7 +32,7 @@ //slider .styles-module_item-tracker__3bypy{ - padding-top : 20px; + padding-top : 20px !important; // transform: translateY(-20px) !important; } diff --git a/src/components/AddToCart/index.js b/src/components/AddToCart/index.js index c625ee7..682ebaa 100644 --- a/src/components/AddToCart/index.js +++ b/src/components/AddToCart/index.js @@ -47,7 +47,7 @@ const AddToCartCard = ({ )} {specialities.map((item, index) => ( -
+
{item.icon && }

{item.description}

diff --git a/src/components/Checkbox/index.js b/src/components/Checkbox/index.js index f9d4f26..5ec709b 100644 --- a/src/components/Checkbox/index.js +++ b/src/components/Checkbox/index.js @@ -2,7 +2,6 @@ import React from "react"; import './index.css'; export default function Checkbox(props) { - // console.log(props) return (
diff --git a/src/components/Footer/index.js b/src/components/Footer/index.js index c03ea1c..f6b126d 100644 --- a/src/components/Footer/index.js +++ b/src/components/Footer/index.js @@ -11,9 +11,6 @@ import bazarIcon from "./Bazar.svg"; import lightBlueLine from "./light-blue-line.svg"; const FooterDesign1 = ({ color, bg, items, hasHeader }) => { - useEffect(() => { - console.log(window.location.host); - }, []); const enamad = ''; return ( diff --git a/src/components/Navbar/index.js b/src/components/Navbar/index.js index 7df02fc..277f093 100644 --- a/src/components/Navbar/index.js +++ b/src/components/Navbar/index.js @@ -203,7 +203,7 @@ function Navbar({
دانوین @@ -213,7 +213,7 @@ function Navbar({
  • {page.name} @@ -301,7 +301,7 @@ Navbar.defaultProps = { pages: [ { link: "/products", - name: "محصولات", + name: "فروشگاه", }, { link: "/contact-us", @@ -309,11 +309,11 @@ Navbar.defaultProps = { }, { link: "/about-us", - name: "درباره ما", + name: "درباره دانوین", }, { link: "/blogs", - name: "وبلاگ", + name: "مجله دانوین", }, ], logo: true, diff --git a/src/components/ProductDescription/index.js b/src/components/ProductDescription/index.js index 7ab7eb4..0269b5a 100644 --- a/src/components/ProductDescription/index.js +++ b/src/components/ProductDescription/index.js @@ -1,135 +1,126 @@ - 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( - <> -
    -
      - {navTitles.map(item =>
    • { - // type[item.id] = type - // type[item.id] = !type[item.id] - setName(item.name) - // setType(type) - // console.log(type) - // console.log(item.id) - // console.log(type[item.id]) - - }}> - {item.title}
    • )} -
    -
    -
    -
    - - {items.map(e => ( - e.name == name ? - e.items.map(item => ( -
      - - {item.title ? -
    • {item.title}
    • : null} -
    • {item.description}
    • -
    - - )) : null - - - ))} -
    -
    - {addToCart} -
    - -
    - - ); +const ProductDescription = ({ navTitles, items, addToCart }) => { + const [name, setName] = useState(navTitles[0].name); + const [type, setType] = useState([]); + return ( + <> +
    +
      + {navTitles.map((item, index) => ( +
    • { + setName(item.name); + }} + > + {item.title} +
    • + ))} +
    +
    +
    +
    + {items.map((item, index) => + item.name == name + ? item.items.map((item, index) => ( +
      + {item.title ? ( +
    • + {item.title} +
    • + ) : null} +
    • + {item.description} +
    • +
    + )) + : null + )} +
    +
    {addToCart}
    +
    + + ); }; - - - - export default ProductDescription; - - - ProductDescription.defaultProps = { - navTitles: [ + navTitles: [ + { + id: 0, + title: "مشخصات", + isActive: true, + name: "moshakhasat", + }, + { + id: 1, + title: "نقد و بررسی", + isActive: false, + name: "review", + }, + { + id: 2, + title: "برسش و باسخ", + isActive: false, + }, + ], + items: [ + { + name: "moshakhasat", + items: [ { - id: 0, - title: 'مشخصات', - isActive: true, - name: 'moshakhasat' + title: "وزن کتاب", + description: "۱ کیلوگرم", }, { - id: 1, - title: 'نقد و بررسی', - isActive: false, - name: 'review' + title: "تعداد صفحات", + description: "400 صفحه", }, { - id: 2, - title: 'برسش و باسخ', - isActive:false + title: "نوع کاغذ", + description: "گلاسه", }, - ], - items: [ { - name: 'moshakhasat', - items: [ - { - title : 'وزن کتاب', - description: '۱ کیلوگرم' - }, - { - title : 'تعداد صفحات', - description: '400 صفحه' - }, - { - title : 'نوع کاغذ', - description: 'گلاسه' - }, - { - title : 'شماره شابک', - description: '1225548218000005818765' - }, - { - title : 'انتشارات', - description: 'رزمندگان' - }, - { - title : 'نویسنده و یا معلف', - description: 'یک نویسنده گمنام' - }, - { - title : 'قطع', - description: 'خشتی' - }, - { - title : 'سال انتشار', - description: '1399' - }, - ] + title: "شماره شابک", + description: "1225548218000005818765", }, { - name: 'review', - items: [{ - description: 'لورم ایبسوم' - }] - } - ] - -} \ No newline at end of file + title: "انتشارات", + description: "رزمندگان", + }, + { + title: "نویسنده و یا معلف", + description: "یک نویسنده گمنام", + }, + { + title: "قطع", + description: "خشتی", + }, + { + title: "سال انتشار", + description: "1399", + }, + ], + }, + { + name: "review", + items: [ + { + description: "لورم ایبسوم", + }, + ], + }, + ], +}; diff --git a/src/components/ProductImage/index.js b/src/components/ProductImage/index.js index 9c8f0fc..4260981 100644 --- a/src/components/ProductImage/index.js +++ b/src/components/ProductImage/index.js @@ -7,13 +7,11 @@ import productImg from "./product-image.jpg"; const ProductImage = ({ images }) => { const [list, setList] = useState([]); const [activeImage, setActiveImage] = useState(null); - // console.log(images.length); useEffect(() => { if (images) { let mylist = images?.split(","); setList(() => mylist); setActiveImage(() => mylist[0]); - console.log(images); } }, [images]); return ( @@ -67,8 +65,5 @@ const ProductImage = ({ images }) => {
  • ); }; -// {[0, 1, 2, 3, 4].map((item, index) => ( - -// ))} export default ProductImage; diff --git a/src/components/ProductTab/table/index.js b/src/components/ProductTab/table/index.js index a8c1cea..7bdf02c 100644 --- a/src/components/ProductTab/table/index.js +++ b/src/components/ProductTab/table/index.js @@ -16,7 +16,7 @@ const Table = ({ specifications }) => { return (