From 5fbb41c47723351edee8e03a2dfc7cf4b2bb46ad Mon Sep 17 00:00:00 2001 From: ItzMineyy Date: Sat, 28 Dec 2024 16:39:57 +0100 Subject: [PATCH] Updated the navbar hiding logic to actually work --- src/app/app.component.ts | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 20386a8..28e5b19 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -93,12 +93,22 @@ export class AppComponent implements OnInit { const currentRoute = this.activatedRoute.snapshot.firstChild?.routeConfig?.path; // Hide navbar and footer on admin route - if (currentRoute === 'admin'||'login') { - this.showNavbar = false; - this.showFooter = false; - } else { - this.showNavbar = true; - this.showFooter = true; + switch (currentRoute) { + case 'admin': { + this.showNavbar = false; + this.showFooter = false; + break; + } + case "login": { + this.showNavbar = false; + this.showFooter = false; + break; + } + default: { + this.showNavbar = true; + this.showFooter = true; + break; + } } } }