feat: integrate Tailwind CSS and implement dark mode functionality

- Added Tailwind CSS dependencies and configured PostCSS.
- Updated app component to wrap router outlet with a styled div for dark mode support.
- Modified routing to include a default route and added auth guards.
- Implemented dark mode toggle functionality in content component.
- Enhanced login component with improved styling and lifecycle management.
- Created items component with basic structure and routing.
- Added global styles for body and dark mode variants.
- Updated tests for new items component.
This commit is contained in:
Marek Lesko
2025-08-06 19:53:23 +00:00
parent 02116aa3df
commit 7919a93ab4
17 changed files with 890 additions and 52 deletions

View File

@@ -1,16 +1,18 @@
import { JsonPipe } from '@angular/common';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Component, isDevMode, signal } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Component, OnInit, signal } from '@angular/core';
import { OAuthService } from 'angular-oauth2-oidc';
import { AppConfigService } from '../services/config.service';
import { RouterLink, RouterOutlet } from "@angular/router";
import { setTheme } from '../app';
@Component({
selector: 'app-content',
imports: [JsonPipe],
imports: [JsonPipe, RouterOutlet, RouterLink],
templateUrl: './content.html',
styleUrl: './content.scss'
})
export class Content {
export class Content implements OnInit {
data = signal({});
constructor(httpClient: HttpClient, readonly as: OAuthService, readonly cs: AppConfigService) {
@@ -19,4 +21,16 @@ export class Content {
this.data.set(data);
});
}
ngOnInit(): void {
setTheme();
}
toggleMode() {
sessionStorage.getItem('isDarkMode') === 'true' ?
sessionStorage.setItem('isDarkMode', 'false') : sessionStorage.setItem('isDarkMode', 'true');
setTheme();
}
}