From 44c163703c2e4188c40f3a94379d67b1cc2ee877 Mon Sep 17 00:00:00 2001 From: Igor Propisnov Date: Tue, 23 Jul 2024 23:47:35 +0200 Subject: [PATCH] added shadow, and new root page for event managment --- frontend/src/app/app.routes.ts | 8 +++++++- .../layout/main-layout/layout.component.html | 18 +++++++++++------- .../app/layout/main-layout/layout.component.ts | 15 ++++++++++++--- .../pages/event-root/event-root.component.html | 1 + .../pages/event-root/event-root.component.ts | 12 ++++++++++++ 5 files changed, 43 insertions(+), 11 deletions(-) create mode 100644 frontend/src/app/pages/event-root/event-root.component.html create mode 100644 frontend/src/app/pages/event-root/event-root.component.ts diff --git a/frontend/src/app/app.routes.ts b/frontend/src/app/app.routes.ts index a9754fc..e445049 100644 --- a/frontend/src/app/app.routes.ts +++ b/frontend/src/app/app.routes.ts @@ -26,7 +26,13 @@ const protectedRoutes: Routes = [ import('./pages/dashboard-root/dashboard-root.component').then( (m) => m.DashboardRootComponent ), - canActivate: [], + }, + { + path: 'event', + loadComponent: () => + import('./pages/event-root/event-root.component').then( + (m) => m.EventRootComponent + ), }, ]; diff --git a/frontend/src/app/layout/main-layout/layout.component.html b/frontend/src/app/layout/main-layout/layout.component.html index 1ec156f..e923857 100644 --- a/frontend/src/app/layout/main-layout/layout.component.html +++ b/frontend/src/app/layout/main-layout/layout.component.html @@ -3,18 +3,18 @@ [ngStyle]="navigation" [class]=" isCollapsed - ? 'bg-primary w-0 md:w-20 transition-all duration-300 ease-in-out' + ? 'bg-primary w-0 md:w-20 transition-all duration-300 ease-in-out shadow-[5px_0_20px_rgba(0,0,0,0.5)]' : showMobileMenu - ? 'bg-primary w-64 transition-all duration-300 ease-in-out' + ? 'bg-primary w-64 transition-all duration-300 ease-in-out shadow-[5px_0_20px_rgba(0,0,0,0.5)]' : isDesktopCollapsed - ? 'bg-primary w-48 md:w-14 transition-all duration-300 ease-in-out' - : 'bg-primary w-48 md:w-48 transition-all duration-300 ease-in-out' + ? 'bg-primary w-48 md:w-14 transition-all duration-300 ease-in-out shadow-[5px_0_20px_rgba(0,0,0,0.5)]' + : 'bg-primary w-48 md:w-48 transition-all duration-300 ease-in-out shadow-[5px_0_20px_rgba(0,0,0,0.5)]' " class="transform h-full z-20 overflow-y-auto fixed md:relative flex flex-col">
+ class="p-1 w-full h-16 z-50 bg-base-100 flex items-center relative">
@if (!isCollapsed && !isDesktopCollapsed) { @@ -60,7 +60,8 @@ class="cursor-pointer rounded-btn mt-2" [ngClass]="{ 'bg-base-100 text-primary': item.active, - 'text-primary-content hover:text-base-content': !item.active + 'text-primary-content hover:text-accent-content hover:bg-accent': + !item.active }" (click)="setActive(item)" (keydown.enter)="setActive(item)" @@ -114,7 +115,7 @@
+ class="p-4 z-0 md:z-20 relative bg-primary text-primary-content flex items-center h-16 shadow-[0_5px_20px_rgba(0,0,0,0.5)]">
diff --git a/frontend/src/app/layout/main-layout/layout.component.ts b/frontend/src/app/layout/main-layout/layout.component.ts index c711d32..080481c 100644 --- a/frontend/src/app/layout/main-layout/layout.component.ts +++ b/frontend/src/app/layout/main-layout/layout.component.ts @@ -38,7 +38,6 @@ export class LayoutComponent implements OnInit { public isCollapsed: boolean = false; public isDesktopCollapsed: boolean = false; public showMobileMenu: boolean = false; - public userHasInteracted: boolean = false; public menuItems: TopMenuItem[] = [ { name: 'Dashboard', @@ -48,6 +47,14 @@ export class LayoutComponent implements OnInit { `), }, + { + name: 'Event', + route: '/event', + icon: this.sanitizer + .bypassSecurityTrustHtml(` + + `), + }, ]; public bottomMenuItems: BottomMenuItem[] = [ { @@ -134,7 +141,6 @@ export class LayoutComponent implements OnInit { } else { this.isDesktopCollapsed = !this.isDesktopCollapsed; } - this.userHasInteracted = true; } public toggleDesktopSidebar(): void { @@ -145,7 +151,10 @@ export class LayoutComponent implements OnInit { this.menuItems.forEach((menu: TopMenuItem) => { menu.active = false; }); - item.active = true; + this.router.navigate([item.route]); + if (!this.isCollapsed && this.showMobileMenu) { + this.toggleSidebar(); + } } private setActiveItemBasedOnRoute(): void { diff --git a/frontend/src/app/pages/event-root/event-root.component.html b/frontend/src/app/pages/event-root/event-root.component.html new file mode 100644 index 0000000..164b9f2 --- /dev/null +++ b/frontend/src/app/pages/event-root/event-root.component.html @@ -0,0 +1 @@ +

Event Root Works

diff --git a/frontend/src/app/pages/event-root/event-root.component.ts b/frontend/src/app/pages/event-root/event-root.component.ts new file mode 100644 index 0000000..5d02ac9 --- /dev/null +++ b/frontend/src/app/pages/event-root/event-root.component.ts @@ -0,0 +1,12 @@ +import { CommonModule } from '@angular/common'; +import { Component, ChangeDetectionStrategy } from '@angular/core'; + +@Component({ + selector: 'app-event-root', + standalone: true, + imports: [CommonModule], + providers: [], + templateUrl: './event-root.component.html', + changeDetection: ChangeDetectionStrategy.OnPush, +}) +export class EventRootComponent {}