bookmark-icon

This commit is contained in:
Patrick Haßel 2025-11-20 14:37:12 +01:00
parent bed87bb0e2
commit a7050cb6f1
3 changed files with 31 additions and 3 deletions

View File

@ -9,6 +9,16 @@
{{ menuService.title }}
</div>
@if (locationService.id !== null) {
<div class="MainMenuItem" (click)="configService.locationId = locationService.id">
@if (configService.locationId === locationService.id) {
<fa-icon [icon]="faBookmarkSolid" class="bookmarkActive"></fa-icon>
} @else {
<fa-icon [icon]="faBookmarkRegular" class="bookmarkInactive"></fa-icon>
}
</div>
}
<div class="MainMenuItem" routerLink="/Location">
<fa-icon [icon]="faHome"></fa-icon>
</div>

View File

@ -6,6 +6,7 @@
.MainMenuBar {
display: flex;
padding: 0.25em;
font-size: 120%;
.MainMenuItem {
padding: 0.25em;
@ -29,6 +30,14 @@
color: red;
}
.bookmarkInactive {
color: lightgray;
}
.bookmarkActive {
color: steelblue;
}
}
}

View File

@ -1,12 +1,13 @@
import {Component, OnDestroy, OnInit} from '@angular/core';
import {Router, RouterLink, RouterLinkActive, RouterOutlet} from '@angular/router';
import {FaIconComponent} from '@fortawesome/angular-fontawesome';
import {faBars, faGears} from '@fortawesome/free-solid-svg-icons';
import {faBars, faBookmark as faBookmarkSolid, faGears} from '@fortawesome/free-solid-svg-icons';
import {MenuService} from './menu-service';
import {Location} from './location/Location';
import {LocationService} from './location/location-service';
import {WebsocketService} from './common';
import {faHome} from '@fortawesome/free-regular-svg-icons';
import {faBookmark as faBookmarkRegular, faHome} from '@fortawesome/free-regular-svg-icons';
import {ConfigService} from './config.service';
@Component({
selector: 'app-root',
@ -16,6 +17,14 @@ import {faHome} from '@fortawesome/free-regular-svg-icons';
})
export class App implements OnInit, OnDestroy {
protected readonly faHome = faHome;
protected readonly location = location;
protected readonly faBookmarkRegular = faBookmarkRegular;
protected readonly faBookmarkSolid = faBookmarkSolid;
protected readonly faGears = faGears;
protected readonly faBars = faBars;
@ -26,6 +35,7 @@ export class App implements OnInit, OnDestroy {
constructor(
readonly locationService: LocationService,
readonly configService: ConfigService,
readonly menuService: MenuService,
readonly router: Router,
readonly ws: WebsocketService,
@ -48,5 +58,4 @@ export class App implements OnInit, OnDestroy {
})
}
protected readonly faHome = faHome;
}