From 798d530d629dc96752c9b3d896de4647672bc2ad Mon Sep 17 00:00:00 2001 From: JOKI6696 Date: Wed, 26 Apr 2023 12:52:25 -0500 Subject: [PATCH] feat: Changes margins and filters products in menu --- .../src/app/menu/menu.component.html | 15 +++--- .../src/app/menu/menu.component.scss | 3 +- burguer-queen/src/app/menu/menu.component.ts | 51 ++++++++++++------- 3 files changed, 42 insertions(+), 27 deletions(-) diff --git a/burguer-queen/src/app/menu/menu.component.html b/burguer-queen/src/app/menu/menu.component.html index 3f51a3fc..eec47724 100644 --- a/burguer-queen/src/app/menu/menu.component.html +++ b/burguer-queen/src/app/menu/menu.component.html @@ -21,7 +21,7 @@
-
+
@@ -33,16 +33,16 @@ @@ -76,11 +76,8 @@
{{ product.name }}
-
- -
-
+
diff --git a/burguer-queen/src/app/menu/menu.component.scss b/burguer-queen/src/app/menu/menu.component.scss index bcb462ad..1682789b 100644 --- a/burguer-queen/src/app/menu/menu.component.scss +++ b/burguer-queen/src/app/menu/menu.component.scss @@ -155,7 +155,8 @@ .col-segundaC { background-color: #fde293; opacity: 9; - border-radius: 10px; + border-radius: 25px; + box-shadow: 0px 0px 10px rgba(0,0,0,0.3); } .col-orden { margin-top: 20px; diff --git a/burguer-queen/src/app/menu/menu.component.ts b/burguer-queen/src/app/menu/menu.component.ts index 1f02a458..0a272cfd 100644 --- a/burguer-queen/src/app/menu/menu.component.ts +++ b/burguer-queen/src/app/menu/menu.component.ts @@ -1,6 +1,7 @@ import { Component } from '@angular/core'; import { ApiBQService } from '../services/api-bq.service'; import { Router } from '@angular/router'; +import { LoginComponent } from '../login/login.component'; @Component({ selector: 'app-menu', @@ -24,10 +25,11 @@ export class MenuComponent { } loadProducts() { - this.api.getMenu().subscribe({ + this.api.getMenu() + .subscribe({ next: (data: any) => { console.log(data); - this.products = Object.values(data); + this.products = data; // this.loading = false; console.log(this.products); @@ -37,19 +39,37 @@ export class MenuComponent { showCard(productType: string) { // if (!this.loading) { - const filteredProducts = this.products.filter(product => product.type === productType); - - if (filteredProducts.length > 0) { - const product = filteredProducts[0]; - this.cardTitle = product.name; - this.cardPrice = '$' + product.price; - this.cardImage = product.image; - this.cardVisible = true; - } else { - this.cardVisible = false; - } + //console.log('hola soy linea 42') + console.log(productType) + this.products = this.products.filter(product => product.type === productType); + console.log(this.products) + + // if (filteredProducts.length > 0) { + // const product = filteredProducts[0]; + // this.cardTitle = product.name; + // this.cardPrice = '$' + product.price; + // this.cardImage = product.image; + // this.cardVisible = true; + // } else { + // this.cardVisible = false; + // } } - //} + +// showCard(productType: string) { +// // if (!this.loading) { +// const filteredProducts = this.products.filter(product => product.type === productType); + +// if (filteredProducts.length > 0) { +// const product = filteredProducts[0]; +// this.cardTitle = product.name; +// this.cardPrice = '$' + product.price; +// this.cardImage = product.image; +// this.cardVisible = true; +// } else { +// this.cardVisible = false; +// } +// } +// //} @@ -111,6 +131,3 @@ export class MenuComponent { } } - - -