30 lines
987 B
TypeScript
30 lines
987 B
TypeScript
import { Component } from '@angular/core';
|
|
import { RouterModule } from '@angular/router';
|
|
import { HermesClientService } from '../hermes-client.service';
|
|
import { ApiAuthenticationService } from '../shared/services/api/api-authentication.service';
|
|
import { MatCardModule } from '@angular/material/card';
|
|
import { AuthModule } from '../auth/auth.module';
|
|
import { UserCardComponent } from "../auth/user-card/user-card.component";
|
|
|
|
@Component({
|
|
selector: 'navigation',
|
|
standalone: true,
|
|
imports: [RouterModule, MatCardModule, AuthModule, UserCardComponent],
|
|
templateUrl: './navigation.component.html',
|
|
styleUrl: './navigation.component.scss'
|
|
})
|
|
export class NavigationComponent {
|
|
constructor(private auth: ApiAuthenticationService, private hermes: HermesClientService) { }
|
|
|
|
isLoggedIn() {
|
|
return this.auth.isAuthenticated();
|
|
}
|
|
|
|
isAdmin() {
|
|
return this.isLoggedIn() && this.auth.isAdmin()
|
|
}
|
|
|
|
isTTSLoggedIn() {
|
|
return this.hermes?.logged_in ?? false;
|
|
}
|
|
} |