Twitch login, TTS Login, and basic policies ui.

This commit is contained in:
Tom
2024-10-17 08:48:15 +00:00
parent f2133bbc0e
commit 89d944cd6e
48 changed files with 1443 additions and 504 deletions

View File

@ -0,0 +1,28 @@
<nav>
<ul>
<li>
<a
routerLink="/login"
routerLinkActive="active"
*ngIf="!twitch_logged_in">
Login
</a>
</li>
<li>
<a
routerLink="/tts-login"
routerLinkActive="active"
*ngIf="twitch_logged_in && !tts_logged_in">
TTS Login
</a>
</li>
<li>
<a
routerLink="/policies"
routerLinkActive="active"
*ngIf="twitch_logged_in && tts_logged_in">
Policies
</a>
</li>
</ul>
</nav>

View File

@ -0,0 +1,37 @@
$primary_background_color: #EEEEEE;
$primary_font_color: #111111;
$secondary_background_color: #DDDDDD;
$secondary_font_color: #333333;
ul {
padding: 0;
}
li {
list-style: none;
width: 100%;
display: flex;
flex-grow: 1;
justify-content: center;
flex-direction: column;
}
a {
background-color: transparent;
padding: 1em;
border: 0;
margin: 0;
font-size: large;
text-decoration: none;
color: $primary_font_color;
}
a:hover {
background-color: #FCFCFC;
}
a.active {
background-color: #F5F5F5;
}

View File

@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { NavigationComponent } from './navigation.component';
describe('NavigationComponent', () => {
let component: NavigationComponent;
let fixture: ComponentFixture<NavigationComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [NavigationComponent]
})
.compileComponents();
fixture = TestBed.createComponent(NavigationComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,24 @@
import { Component } from '@angular/core';
import { RouterModule } from '@angular/router';
import { CommonModule } from '@angular/common';
import { HermesClientService } from '../hermes-client.service';
import { ApiAuthenticationService } from '../shared/services/api/api-authentication.service';
@Component({
selector: 'navigation',
standalone: true,
imports: [CommonModule, RouterModule],
templateUrl: './navigation.component.html',
styleUrl: './navigation.component.scss'
})
export class NavigationComponent {
constructor(private auth: ApiAuthenticationService, private hermes: HermesClientService) { }
get twitch_logged_in() {
return this.auth.isAuthenticated();
}
get tts_logged_in() {
return this.hermes?.logged_in ?? false;
}
}