Add home routerLink on the navbar icon + fix timeline btn

tutorial
Alix JEUDI--LEMOINE 2 weeks ago
parent 260891e8e8
commit 3e8d447106

@ -1,9 +1,9 @@
<nav class="bg-white border-gray-200 dark:bg-gray-900"> <nav class="bg-white border-gray-200 dark:bg-gray-900">
<div <div
class="max-w-screen-xl flex flex-wrap items-center justify-between mx-auto p-4" class="max-w-screen-xl flex flex-wrap items-center justify-between mx-auto p-3"
> >
<a class="flex items-center space-x-3 rtl:space-x-reverse"> <a routerLink="/" class="flex items-center space-x-3 rtl:space-x-reverse">
<img src="./logo.png" class="h-10" alt="Memory Map Logo" /> <img src="./logo.png" class="h-12" alt="Memory Map Logo" />
<span <span
class="self-center text-2xl font-semibold whitespace-nowrap dark:text-white hidden lg:inline" class="self-center text-2xl font-semibold whitespace-nowrap dark:text-white hidden lg:inline"
>Memory Map</span >Memory Map</span
@ -170,13 +170,13 @@
<li> <li>
<a <a
routerLink="/map" routerLink="/map"
*ngIf="isTimeline" *ngIf="!showTimeline"
class="block py-2 text-gray-900 dark:text-white hover:text-gray-700 dark:hover:text-gray-300" class="block py-2 text-gray-900 dark:text-white hover:text-gray-700 dark:hover:text-gray-300"
>Carte</a >Carte</a
> >
<a <a
routerLink="/timeline" routerLink="/timeline"
*ngIf="!isTimeline" *ngIf="showTimeline"
class="block py-2 text-gray-900 dark:text-white hover:text-gray-700 dark:hover:text-gray-300" class="block py-2 text-gray-900 dark:text-white hover:text-gray-700 dark:hover:text-gray-300"
>Timeline</a >Timeline</a
> >

@ -38,7 +38,7 @@ import { FriendPageComponent } from '../friend-page/friend-page.component';
templateUrl: './navbar.component.html', templateUrl: './navbar.component.html',
}) })
export class NavbarComponent implements OnInit { export class NavbarComponent implements OnInit {
isTimeline: boolean = false; showTimeline: boolean = false;
isSearchOpen: boolean = false; isSearchOpen: boolean = false;
isNavbarOpen: boolean = false; isNavbarOpen: boolean = false;
@ -75,10 +75,10 @@ export class NavbarComponent implements OnInit {
this.pins = pins; this.pins = pins;
}); });
this.isTimeline = this.router.url === '/timeline'; this.showTimeline = this.router.url !== '/timeline' && this.router.url !== '/';
this.router.events.subscribe((event) => { this.router.events.subscribe((event) => {
if (event instanceof NavigationEnd) { if (event instanceof NavigationEnd) {
this.isTimeline = event.url === '/timeline'; this.showTimeline = event.url !== '/timeline' && this.router.url !== '/';
} }
}); });

Loading…
Cancel
Save