Twitch login, TTS Login, and basic policies ui.
This commit is contained in:
28
src/app/navigation/navigation.component.html
Normal file
28
src/app/navigation/navigation.component.html
Normal 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>
|
37
src/app/navigation/navigation.component.scss
Normal file
37
src/app/navigation/navigation.component.scss
Normal 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;
|
||||
}
|
23
src/app/navigation/navigation.component.spec.ts
Normal file
23
src/app/navigation/navigation.component.spec.ts
Normal 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();
|
||||
});
|
||||
});
|
24
src/app/navigation/navigation.component.ts
Normal file
24
src/app/navigation/navigation.component.ts
Normal 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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user