From ce1fe995b8ef6896cdb4b17477478a8f062fc023 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 16 Feb 2022 12:35:13 +0100 Subject: [PATCH] modif card resto --- src/app/card-resto/card-resto.component.html | 40 +++++++++++-------- src/app/card-resto/card-resto.component.scss | 23 ++++++----- src/app/card-resto/card-resto.component.ts | 14 +++++-- src/app/filters/icon/icon.component.html | 3 +- .../pages/home-page/home-page.component.ts | 3 ++ src/app/services/api-back.service.ts | 1 + 6 files changed, 55 insertions(+), 29 deletions(-) diff --git a/src/app/card-resto/card-resto.component.html b/src/app/card-resto/card-resto.component.html index 047081a..b4a6979 100644 --- a/src/app/card-resto/card-resto.component.html +++ b/src/app/card-resto/card-resto.component.html @@ -1,7 +1,11 @@
+ style="width: 21rem;"> Card image cap -
+
+

{{restaurant.nom }}

@@ -26,27 +30,31 @@ 5/5
+
Kebab - 550m - 5-10€ +
-
- Site web - -
+
+ + 550m + 5-10€ + Site web + + +
- Sur place : + Sur place : - A emporter : + A emporter :
@@ -54,7 +62,7 @@
Accès PMR :
diff --git a/src/app/card-resto/card-resto.component.scss b/src/app/card-resto/card-resto.component.scss index 3e6c0ea..f7f768b 100644 --- a/src/app/card-resto/card-resto.component.scss +++ b/src/app/card-resto/card-resto.component.scss @@ -1,17 +1,22 @@ .rond{ - padding: 0.7em; + padding: 1em; background-color: rgb(255, 255, 255); top: 1em; right: 1em; border-radius: 50%; + width: 50px; + height: 50px; + } - .heart{ - display: flex; - font-size: 1.6em; - padding: 0; - margin:0; - color: #FF2048; + position: absolute; + top: 7px; + left: 13px; + font-size: 1.5em; + + + + } .titre-resto{ @@ -37,10 +42,10 @@ } .ps-5 { - padding-left: 5.4rem !important; + padding-left: 6.4rem !important; } .pe-5 { - padding-right: 5rem !important; + padding-right: 6rem !important; } diff --git a/src/app/card-resto/card-resto.component.ts b/src/app/card-resto/card-resto.component.ts index a6acf7b..805a5e3 100644 --- a/src/app/card-resto/card-resto.component.ts +++ b/src/app/card-resto/card-resto.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, OnInit } from '@angular/core'; +import { Component,EventEmitter, Input, Output, OnInit } from '@angular/core'; @Component({ selector: 'app-card-resto', @@ -7,8 +7,11 @@ import { Component, Input, OnInit } from '@angular/core'; }) export class CardRestoComponent implements OnInit { - @Input() restaurant : any ; - + @Input() restaurant : any ; + @Input() likeResto: any; + @Output() clickLike = new EventEmitter(); + isLiked : boolean = false; + constructor() { } ngOnInit(): void { @@ -16,6 +19,11 @@ export class CardRestoComponent implements OnInit { console.log(this.restaurant); } + onClickLike() { + console.log('click'); + this.isLiked = !this.isLiked; + this.clickLike.emit(this.isLiked); + } diff --git a/src/app/filters/icon/icon.component.html b/src/app/filters/icon/icon.component.html index 789856c..322c471 100644 --- a/src/app/filters/icon/icon.component.html +++ b/src/app/filters/icon/icon.component.html @@ -1,3 +1,4 @@ - + diff --git a/src/app/pages/home-page/home-page.component.ts b/src/app/pages/home-page/home-page.component.ts index ebb39f4..3aeb304 100644 --- a/src/app/pages/home-page/home-page.component.ts +++ b/src/app/pages/home-page/home-page.component.ts @@ -30,5 +30,8 @@ export class HomePageComponent implements OnInit { } + onEventLike(isLiked : boolean) { + this.apiBackService.restoLiked$.next(isLiked); + } } diff --git a/src/app/services/api-back.service.ts b/src/app/services/api-back.service.ts index 31c9dce..bae9d36 100644 --- a/src/app/services/api-back.service.ts +++ b/src/app/services/api-back.service.ts @@ -9,6 +9,7 @@ import { environment } from 'src/environments/environment'; export class ApiBackService { public restoByCat : Observable = of([]); + restoLiked$ = new Subject(); constructor(private httpClient: HttpClient) { }