From 07ca16f41c53eccf4a9b959bd4e4656a987d8199 Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Tue, 25 Apr 2023 17:53:24 -0600 Subject: Añade listado de productos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/product_listing.tsx | 67 ++++++++++++++++++++++++++ src/components/stylesheets/navbar.css | 1 - src/components/stylesheets/product_listing.css | 9 ++++ src/components/stylesheets/shared.css | 5 ++ 4 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 src/components/product_listing.tsx create mode 100644 src/components/stylesheets/product_listing.css (limited to 'src/components') diff --git a/src/components/product_listing.tsx b/src/components/product_listing.tsx new file mode 100644 index 0000000..497bd19 --- /dev/null +++ b/src/components/product_listing.tsx @@ -0,0 +1,67 @@ +import { Collapse, Ripple, initTE} from "tw-elements"; +initTE({Collapse, Ripple}); +import "./stylesheets/shared.css" +import "./stylesheets/product_listing.css" + +export default function ProductListing({ product }) { + const collapseMenu = `collapse${product.id}` + const collapseTarget = `#${collapseMenu}` + const categories = product.attributes.categories.map(category => + +
  • {category}
  • + ); + + return ( +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + +
    {product.attributes.name}
    Precio al por menor{product.attributes.unitary_price} $
    Precio al por mayor{product.attributes.bulk_price} $
    Proveedor{product.attributes.company.name}
    +
    + +
    +
    +
      +
    • {categories}
    • +
    +
    +
    +
    +
    +
    +
    + ); +} \ No newline at end of file diff --git a/src/components/stylesheets/navbar.css b/src/components/stylesheets/navbar.css index 75748a6..357271f 100644 --- a/src/components/stylesheets/navbar.css +++ b/src/components/stylesheets/navbar.css @@ -1,7 +1,6 @@ .navbar { overflow: hidden; margin-bottom: 5px; - /*position: fixed;*/ top: 0; width: 100%; border-bottom: solid 5px #394490; diff --git a/src/components/stylesheets/product_listing.css b/src/components/stylesheets/product_listing.css new file mode 100644 index 0000000..c926448 --- /dev/null +++ b/src/components/stylesheets/product_listing.css @@ -0,0 +1,9 @@ +.product-listing { + width: 70%; + margin-top: 4px; + margin-bottom: 4px; +} + +.product-listing-text { + color: #394490; +} \ No newline at end of file diff --git a/src/components/stylesheets/shared.css b/src/components/stylesheets/shared.css index dd50228..2cda15b 100644 --- a/src/components/stylesheets/shared.css +++ b/src/components/stylesheets/shared.css @@ -13,4 +13,9 @@ .main-view { width: 80%; margin: auto; +} + +.listing-image { + height: 296px; + width: auto; } \ No newline at end of file -- cgit v1.2.3