Prettier and rebase
This commit is contained in:
parent
c3f9ba7bca
commit
f6bcc1be11
8 changed files with 30 additions and 33 deletions
|
@ -1,4 +1,8 @@
|
||||||
import { APP_INITIALIZER, ApplicationConfig, provideExperimentalZonelessChangeDetection } from '@angular/core';
|
import {
|
||||||
|
APP_INITIALIZER,
|
||||||
|
ApplicationConfig,
|
||||||
|
provideExperimentalZonelessChangeDetection,
|
||||||
|
} from '@angular/core';
|
||||||
import { provideRouter } from '@angular/router';
|
import { provideRouter } from '@angular/router';
|
||||||
|
|
||||||
import { routes } from './app.routes';
|
import { routes } from './app.routes';
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import {Routes} from '@angular/router';
|
import { Routes } from '@angular/router';
|
||||||
import {LandingPageComponent} from "./landing-page/landing-page.component";
|
import { LandingPageComponent } from './landing-page/landing-page.component';
|
||||||
import {HomepageComponent} from "./homepage/homepage/homepage.component";
|
import { HomepageComponent } from './homepage/homepage/homepage.component';
|
||||||
import {authGuard} from "./auth.guard";
|
import { authGuard } from './auth.guard';
|
||||||
|
|
||||||
export const routes: Routes = [
|
export const routes: Routes = [
|
||||||
{
|
{
|
||||||
|
@ -16,7 +16,6 @@ export const routes: Routes = [
|
||||||
path: 'home',
|
path: 'home',
|
||||||
component: HomepageComponent,
|
component: HomepageComponent,
|
||||||
},
|
},
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {CanActivateFn} from '@angular/router';
|
import { CanActivateFn } from '@angular/router';
|
||||||
import {inject} from '@angular/core';
|
import { inject } from '@angular/core';
|
||||||
import {KeycloakService} from 'keycloak-angular';
|
import { KeycloakService } from 'keycloak-angular';
|
||||||
|
|
||||||
export const authGuard: CanActivateFn = async () => {
|
export const authGuard: CanActivateFn = async () => {
|
||||||
const keycloakService = inject(KeycloakService);
|
const keycloakService = inject(KeycloakService);
|
||||||
|
|
|
@ -1,16 +1,11 @@
|
||||||
|
|
||||||
<nav class="bg-black border-b border-amber-600/30 sticky top-0 z-50">
|
<nav class="bg-black border-b border-amber-600/30 sticky top-0 z-50">
|
||||||
<div class="container mx-auto px-4 py-3 flex justify-between items-center">
|
<div class="container mx-auto px-4 py-3 flex justify-between items-center">
|
||||||
<!-- logo goes here -->
|
<!-- logo goes here -->
|
||||||
<div class="flex gap-4">
|
<div class="flex gap-4">
|
||||||
<button class="btn-primary">
|
<button class="btn-primary" (click)="logout()">Ausloggen</button>
|
||||||
Ausloggen
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button class="btn-primary">
|
<button class="btn-primary">Benutzer</button>
|
||||||
Benutzer
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
|
@ -1,12 +1,17 @@
|
||||||
import {ChangeDetectionStrategy, Component} from '@angular/core';
|
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
|
||||||
|
import { KeycloakService } from 'keycloak-angular';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-homepage',
|
selector: 'app-homepage',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [],
|
imports: [],
|
||||||
templateUrl: './homepage.component.html',
|
templateUrl: './homepage.component.html',
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
})
|
})
|
||||||
export class HomepageComponent {
|
export class HomepageComponent {
|
||||||
|
private keycloakService: KeycloakService = inject(KeycloakService);
|
||||||
|
|
||||||
|
logout() {
|
||||||
|
this.keycloakService.logout();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import {Component, inject} from '@angular/core';
|
import { Component, inject } from '@angular/core';
|
||||||
import {KeycloakService} from "keycloak-angular";
|
import { KeycloakService } from 'keycloak-angular';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-landing-page',
|
selector: 'app-landing-page',
|
||||||
|
@ -11,10 +11,6 @@ export class LandingPageComponent {
|
||||||
private keycloakService: KeycloakService = inject(KeycloakService);
|
private keycloakService: KeycloakService = inject(KeycloakService);
|
||||||
|
|
||||||
login() {
|
login() {
|
||||||
this.keycloakService.login()
|
this.keycloakService.login();
|
||||||
.catch(error => {
|
|
||||||
alert("Error: Unable to redirect to login page. Please try again later.");
|
|
||||||
console.error('Error redirecting to login:', error);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
@import "tailwindcss";
|
@import 'tailwindcss';
|
||||||
|
|
||||||
|
|
||||||
.btn-primary {
|
.btn-primary {
|
||||||
@apply px-4 py-2 cursor-pointer relative font-bold rounded-lg transition-all duration-300 ease-out transform-gpu hover:scale-105 will-change-transform bg-gradient-to-r from-emerald-500 to-emerald-400 text-black hover:shadow-xl hover:shadow-emerald-500/20
|
@apply px-4 py-2 cursor-pointer relative font-bold rounded-lg transition-all duration-300 ease-out transform-gpu hover:scale-105 will-change-transform bg-gradient-to-r from-emerald-500 to-emerald-400 text-black hover:shadow-xl hover:shadow-emerald-500/20;
|
||||||
}
|
}
|
||||||
.btn-secondary {
|
.btn-secondary {
|
||||||
@apply px-4 py-2 cursor-pointer relative font-bold rounded-lg transition-all duration-300 ease-out transform-gpu hover:scale-105 will-change-transform bg-white/10 text-white hover:bg-white/20
|
@apply px-4 py-2 cursor-pointer relative font-bold rounded-lg transition-all duration-300 ease-out transform-gpu hover:scale-105 will-change-transform bg-white/10 text-white hover:bg-white/20;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue