From 21508a3514500f8f38ddaa8bef7a9cd420d76628 Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Mon, 22 May 2023 21:18:20 -0600 Subject: Añade carrito MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/navbar.tsx | 26 ++++++++++++++++++++------ src/components/payment_methods_table.tsx | 8 +++++++- src/components/product_cart.tsx | 28 ++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 7 deletions(-) create mode 100644 src/components/product_cart.tsx (limited to 'src/components') diff --git a/src/components/navbar.tsx b/src/components/navbar.tsx index d136e31..4078405 100644 --- a/src/components/navbar.tsx +++ b/src/components/navbar.tsx @@ -2,8 +2,26 @@ import { CartFill } from "react-bootstrap-icons"; import "./stylesheets/navbar.css"; import "./stylesheets/shared.css"; import MainPageDropdownMenu from "./main_page_dropdown_menu"; +import Token from "../lib/token"; export default function Navbar() { + const session = new Token(); + let cart; + + if (session.present()) { + cart = ( + + + + + + ); + } + else { + cart = null; + } + return( <>
@@ -33,12 +51,8 @@ export default function Navbar() { { /* Lado derecho */}
- - - - - + + {cart}
diff --git a/src/components/payment_methods_table.tsx b/src/components/payment_methods_table.tsx index e9ac639..03fe473 100644 --- a/src/components/payment_methods_table.tsx +++ b/src/components/payment_methods_table.tsx @@ -7,10 +7,16 @@ export default function PaymentMethodsTable({ payment_methods }) { ); return( -
+

Métodos de pago

+
+ + Nuevo método de pago + +
diff --git a/src/components/product_cart.tsx b/src/components/product_cart.tsx new file mode 100644 index 0000000..86d2615 --- /dev/null +++ b/src/components/product_cart.tsx @@ -0,0 +1,28 @@ +import "./stylesheets/product_listing.css"; + +export default function ProductCart({ product }) { + return ( +
+
+ +
+
+
+ {product.name} +
+
+ + Precio unitario + + {product.unitary_price} +
+
+ + Precio al por mayor + + {product.bulk_price} +
+
+
+ ); +} \ No newline at end of file -- cgit v1.2.3