From 5f083f775917c15597b3b70a0eb6a0ce2fda7667 Mon Sep 17 00:00:00 2001 From: sowgro Date: Mon, 31 Mar 2025 11:28:42 -0400 Subject: More css tweaks --- ufund-ui/src/app/app.component.html | 4 ++-- ufund-ui/src/app/app.component.ts | 19 ++++++++++++------- .../src/app/components/login/login.component.html | 1 - ufund-ui/src/styles.css | 2 +- 4 files changed, 15 insertions(+), 11 deletions(-) (limited to 'ufund-ui/src') diff --git a/ufund-ui/src/app/app.component.html b/ufund-ui/src/app/app.component.html index b41a225..89075e1 100644 --- a/ufund-ui/src/app/app.component.html +++ b/ufund-ui/src/app/app.component.html @@ -17,8 +17,8 @@ Cupboard Basket - - + + diff --git a/ufund-ui/src/app/app.component.ts b/ufund-ui/src/app/app.component.ts index 7d9afcd..8068659 100644 --- a/ufund-ui/src/app/app.component.ts +++ b/ufund-ui/src/app/app.component.ts @@ -3,6 +3,8 @@ import {BehaviorSubject, Observable} from 'rxjs'; import { DOCUMENT } from '@angular/common'; import {AuthService} from './services/auth.service'; import {ToastType} from './services/toasts.service'; +import {User} from './models/User'; +import {ActivatedRoute, Router} from '@angular/router'; interface ToastProps { type: ToastType, message: string, action?: {label: string, onAction: () => void} @@ -16,12 +18,14 @@ interface ToastProps { }) export class AppComponent implements OnInit { // title = 'ufund-ui'; - currentUser$: BehaviorSubject = new BehaviorSubject("Logged out."); + currentUser?: BehaviorSubject; toast = new BehaviorSubject({type: ToastType.INFO, message: "testToast"}) constructor( private authService: AuthService, + private router: Router, + private route: ActivatedRoute, @Inject(DOCUMENT) private document: Document ) {} @@ -30,14 +34,15 @@ export class AppComponent implements OnInit { } ngOnInit() { - this.authService.getCurrentUserSubject().subscribe(r => { - this.currentUser$?.next(r - ? "Logged in as " + r.username - : "Logged out." - ) - }) + this.currentUser = this.authService.getCurrentUserSubject() } + login() { + this.router.navigate(['/login'], {queryParams: {redir: this.router.url}}); + } + logout() { + location.reload() + } } diff --git a/ufund-ui/src/app/components/login/login.component.html b/ufund-ui/src/app/components/login/login.component.html index 743b1b3..e1c3e2a 100644 --- a/ufund-ui/src/app/components/login/login.component.html +++ b/ufund-ui/src/app/components/login/login.component.html @@ -1,5 +1,4 @@
- You must be logged in to view this page

Login

diff --git a/ufund-ui/src/styles.css b/ufund-ui/src/styles.css index b3ecbd0..b152e61 100644 --- a/ufund-ui/src/styles.css +++ b/ufund-ui/src/styles.css @@ -32,7 +32,7 @@ input { } } -button, .button { +button, input[type=button], input[type=reset], input[type=submit], .button { font-size: 14pt; padding: 6px 16px; border-radius: 9999px; -- cgit v1.2.3