fix theming + ui improvements
This commit is contained in:
@@ -1,15 +1,29 @@
|
||||
import { Component, inject, signal } from '@angular/core';
|
||||
import { Component, effect, inject, signal } from '@angular/core';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { RouterModule, RouterOutlet } from '@angular/router';
|
||||
import { Authentication } from './services/authentication';
|
||||
import { keycloakConfig } from './util/keycloak-config';
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
imports: [RouterOutlet, MatButtonModule, RouterModule],
|
||||
templateUrl: './app.html',
|
||||
styleUrl: './app.scss',
|
||||
selector: 'app-root',
|
||||
imports: [RouterOutlet, MatButtonModule, RouterModule],
|
||||
templateUrl: './app.html',
|
||||
styleUrl: './app.scss',
|
||||
})
|
||||
export class App {
|
||||
protected readonly title = signal('frontend');
|
||||
protected readonly auth = inject(Authentication);
|
||||
protected readonly title = signal('frontend');
|
||||
protected readonly auth = inject(Authentication);
|
||||
|
||||
protected gotoProfile() {
|
||||
window.location.href = `${keycloakConfig.url}/realms/${keycloakConfig.realm}/account`;
|
||||
}
|
||||
|
||||
constructor() {
|
||||
effect(() => {
|
||||
const loggedIn = this.auth.loggedIn();
|
||||
if (!loggedIn) {
|
||||
this.auth.login();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user