From 76d950f10fe57f47b6aeef0e662cfd9136bda745 Mon Sep 17 00:00:00 2001 From: oussamaB14 <88203283+oussamaB14@users.noreply.github.com> Date: Thu, 2 May 2024 12:17:01 +0100 Subject: [PATCH] adding login status on the navbar of the landing page --- .../components/navbar/navbar.component.html | 22 +++++++++++++------ .../components/navbar/navbar.component.ts | 6 +++-- .../side-bar/side-bar.component.html | 8 ++++++- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/front/src/app/shared/components/navbar/navbar.component.html b/front/src/app/shared/components/navbar/navbar.component.html index 2d555ba..c6bef91 100644 --- a/front/src/app/shared/components/navbar/navbar.component.html +++ b/front/src/app/shared/components/navbar/navbar.component.html @@ -78,19 +78,27 @@ diff --git a/front/src/app/shared/components/navbar/navbar.component.ts b/front/src/app/shared/components/navbar/navbar.component.ts index 14df271..e75476e 100644 --- a/front/src/app/shared/components/navbar/navbar.component.ts +++ b/front/src/app/shared/components/navbar/navbar.component.ts @@ -1,4 +1,5 @@ import { Component, ElementRef, ViewChild } from '@angular/core'; +import { AuthService } from '../../../modules/auth/services/auth.service'; @Component({ selector: 'app-navbar', @@ -10,7 +11,8 @@ export class NavbarComponent { lastScrollPosition: number; - constructor() {} + constructor(private authService: AuthService) {} + ngAfterViewInit() { window.addEventListener('scroll', () => { @@ -31,6 +33,6 @@ export class NavbarComponent { }); } isLoggedIn(): boolean { - return false; + return this.authService.isLoggedIn(); } } diff --git a/front/src/app/shared/components/side-bar/side-bar.component.html b/front/src/app/shared/components/side-bar/side-bar.component.html index 447554f..91f53cb 100644 --- a/front/src/app/shared/components/side-bar/side-bar.component.html +++ b/front/src/app/shared/components/side-bar/side-bar.component.html @@ -1,6 +1,12 @@