+11
-1
@@ -6,7 +6,17 @@
|
||||
<app-link *appRole="['presenter']" [icon]="faPresentation" link="/presentation" text="Präsentation"></app-link>
|
||||
<app-link [icon]="faUser" link="/user" text="Benutzer"></app-link>
|
||||
</div>
|
||||
<div *appRole="['user', 'presenter', 'leader']" class="actions">
|
||||
<div class="actions">
|
||||
<button
|
||||
mat-icon-button
|
||||
class="theme-toggle"
|
||||
[attr.aria-label]="themeService.isDarkMode() ? 'Lightmode aktivieren' : 'Darkmode aktivieren'"
|
||||
[attr.title]="themeService.isDarkMode() ? 'Zum Lightmode wechseln' : 'Zum Darkmode wechseln'"
|
||||
(click)="themeService.toggleTheme()">
|
||||
<fa-icon [icon]="themeService.isDarkMode() ? faLightMode : faDarkMode"></fa-icon>
|
||||
</button>
|
||||
</div>
|
||||
<div *appRole="['user', 'presenter', 'leader']" class="actions actions-search">
|
||||
<app-filter></app-filter>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
+16
@@ -32,9 +32,25 @@ nav {
|
||||
display: flex;
|
||||
height: 100%;
|
||||
align-items: center;
|
||||
padding-right: 12px;
|
||||
}
|
||||
|
||||
.actions-search {
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
.theme-toggle {
|
||||
color: var(--text-inverse);
|
||||
transition: var(--transition-fast);
|
||||
|
||||
&:hover {
|
||||
background: var(--hover-background);
|
||||
}
|
||||
}
|
||||
|
||||
.theme-toggle fa-icon {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.links {
|
||||
display: flex;
|
||||
|
||||
+9
-3
@@ -1,5 +1,7 @@
|
||||
import {Component} from '@angular/core';
|
||||
import {faChalkboard, faMusic, faPersonBooth, faUserCog} from '@fortawesome/free-solid-svg-icons';
|
||||
import {Component, inject} from '@angular/core';
|
||||
import {MatIconButton} from '@angular/material/button';
|
||||
import {FaIconComponent} from '@fortawesome/angular-fontawesome';
|
||||
import {faChalkboard, faMoon, faMusic, faPersonBooth, faSun, faUserCog} from '@fortawesome/free-solid-svg-icons';
|
||||
import {fromEvent, Observable} from 'rxjs';
|
||||
import {distinctUntilChanged, map, shareReplay, startWith} from 'rxjs/operators';
|
||||
import {BrandComponent} from './brand/brand.component';
|
||||
@@ -8,18 +10,22 @@ import {RoleDirective} from '../../../../services/user/role.directive';
|
||||
import {LinkComponent} from './link/link.component';
|
||||
import {FilterComponent} from './filter/filter.component';
|
||||
import {AsyncPipe} from '@angular/common';
|
||||
import {ThemeService} from '../../../../services/theme/theme.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-navigation',
|
||||
templateUrl: './navigation.component.html',
|
||||
styleUrls: ['./navigation.component.less'],
|
||||
imports: [BrandComponent, RouterLink, RoleDirective, LinkComponent, FilterComponent, AsyncPipe],
|
||||
imports: [BrandComponent, RouterLink, RoleDirective, LinkComponent, FilterComponent, AsyncPipe, MatIconButton, FaIconComponent],
|
||||
})
|
||||
export class NavigationComponent {
|
||||
public readonly themeService = inject(ThemeService);
|
||||
public faSongs = faMusic;
|
||||
public faShows = faPersonBooth;
|
||||
public faUser = faUserCog;
|
||||
public faPresentation = faChalkboard;
|
||||
public faDarkMode = faMoon;
|
||||
public faLightMode = faSun;
|
||||
|
||||
public readonly windowScroll$: Observable<number> = fromEvent(window, 'scroll').pipe(
|
||||
map(() => window.scrollY),
|
||||
|
||||
Reference in New Issue
Block a user