From b36d2bf40b9f4f4fe2adca81371a2c94d9625f7d Mon Sep 17 00:00:00 2001
From: Hugo BAYOUD <hugo.bayoud@etu.uca.fr>
Date: Mon, 29 Mar 2021 22:20:53 +0200
Subject: [PATCH] generate drinks component and routerLink to /drinks from
 /bars

---
 src/app/app.module.ts                             |  3 ++-
 src/app/app.routing.ts                            |  2 ++
 src/app/components/bars/bars.component.html       |  2 +-
 src/app/components/drinks/drinks.component.css    |  0
 src/app/components/drinks/drinks.component.html   |  7 +++++++
 src/app/components/drinks/drinks.component.ts     | 15 +++++++++++++++
 .../share/components/topbar/topbar.component.ts   |  1 -
 7 files changed, 27 insertions(+), 3 deletions(-)
 create mode 100644 src/app/components/drinks/drinks.component.css
 create mode 100644 src/app/components/drinks/drinks.component.html
 create mode 100644 src/app/components/drinks/drinks.component.ts

diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index 12c7e255..3f06fc67 100644
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -24,9 +24,10 @@ import { environment } from 'src/environments/environment';
 import { reducersMap } from './share/store';
 import { AuthEffects } from './share/store/effects/auth.effects';
 import { BarEffects } from './share/store/effects/bar.effects';
+import { DrinksComponent } from './components/drinks/drinks.component';
 
 @NgModule({
-  declarations: [AppComponent],
+  declarations: [AppComponent, DrinksComponent],
   imports: [
 		BrowserModule,
 		BrowserAnimationsModule,
diff --git a/src/app/app.routing.ts b/src/app/app.routing.ts
index c19269af..046f1fbe 100644
--- a/src/app/app.routing.ts
+++ b/src/app/app.routing.ts
@@ -1,5 +1,6 @@
 import { Route } from "@angular/router";
 import { BarsComponent } from "./components/bars/bars.component";
+import { DrinksComponent } from "./components/drinks/drinks.component";
 import { SigninComponent } from "./components/signin/signin.component";
 import { SignupComponent } from "./components/signup/signup.component";
 import { WelcomeComponent } from "./components/welcome/welcome.component";
@@ -11,6 +12,7 @@ export const APP_ROUTING: Route[] = [
 	{ path: 'photos', canActivate: [AuthGuard], loadChildren: () => import('./photos/photos.module').then(m => m.PhotosModule) },
 	{ path: 'profile', canActivate: [AuthGuard], loadChildren: () => import('./profile/profile.module').then(m => m.ProfileModule) },
 	{ path: 'bars', canActivate: [AuthGuard], component: BarsComponent },
+	{ path: 'drinks', canActivate: [AuthGuard], component: DrinksComponent },
 	{ path: 'signup', canActivate: [AlreadyLoggedInGuard], component: SignupComponent },
 	{ path: 'signin', canActivate: [AlreadyLoggedInGuard], component: SigninComponent },
 	{ path: '', redirectTo: '', pathMatch: 'full' },
diff --git a/src/app/components/bars/bars.component.html b/src/app/components/bars/bars.component.html
index 01a41e2b..0f6bc5a5 100644
--- a/src/app/components/bars/bars.component.html
+++ b/src/app/components/bars/bars.component.html
@@ -13,7 +13,7 @@
 			<div>{{ bar.address }}</div>
 		</div>
 		<div class="card-action">
-			<button mat-raised-button color='accent'>choisir</button>
+			<button mat-raised-button routerLink="/drinks" color='accent'>choisir</button>
 		</div>
 	</div>
 </section>
diff --git a/src/app/components/drinks/drinks.component.css b/src/app/components/drinks/drinks.component.css
new file mode 100644
index 00000000..e69de29b
diff --git a/src/app/components/drinks/drinks.component.html b/src/app/components/drinks/drinks.component.html
new file mode 100644
index 00000000..74be67f4
--- /dev/null
+++ b/src/app/components/drinks/drinks.component.html
@@ -0,0 +1,7 @@
+<p>drinks works!</p>
+<div class="drink-card">
+	<div class="card-img">
+		
+
+	</div>
+</div>
\ No newline at end of file
diff --git a/src/app/components/drinks/drinks.component.ts b/src/app/components/drinks/drinks.component.ts
new file mode 100644
index 00000000..8679885f
--- /dev/null
+++ b/src/app/components/drinks/drinks.component.ts
@@ -0,0 +1,15 @@
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+  selector: 'app-drinks',
+  templateUrl: './drinks.component.html',
+  styleUrls: ['./drinks.component.css']
+})
+export class DrinksComponent implements OnInit {
+
+  constructor() { }
+
+  ngOnInit(): void {
+  }
+
+}
diff --git a/src/app/share/components/topbar/topbar.component.ts b/src/app/share/components/topbar/topbar.component.ts
index 65090091..a18e69e1 100644
--- a/src/app/share/components/topbar/topbar.component.ts
+++ b/src/app/share/components/topbar/topbar.component.ts
@@ -5,7 +5,6 @@ import { Observable } from 'rxjs';
 import { State } from '../../store';
 import { Logout } from '../../store/actions/auth.actions';
 import { isLoggedInAuthSelector } from '../../store/selectors/auth.selectors';
-import { FetchPhotos, SetFilter } from 'src/app/photos/shared/store/photos.actions';
 
 @Component({
   selector: 'app-topbar',
-- 
GitLab