Adding models and components
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
<div id="header">
|
||||
<p id="header-title">Doppelkopf-Stats</p>
|
||||
<span id="user-info">
|
||||
<p>Paddy</p>
|
||||
<img src="assets/images/user.png" alt="User Icon" (click)="openProfile()">
|
||||
</span>
|
||||
<app-profile *ngIf="showProfilePopover"></app-profile>
|
||||
</div>
|
||||
@@ -0,0 +1,36 @@
|
||||
@import '../../../styles';
|
||||
|
||||
#header {
|
||||
width: 100%;
|
||||
height: $header_height;
|
||||
background-color: $accent;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
margin-bottom: 10em;
|
||||
color: black;
|
||||
}
|
||||
|
||||
#header-title {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 1em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#user-info {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 1em;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
#user-info img {
|
||||
height: 2em;
|
||||
margin: auto;
|
||||
padding-left: 1em;
|
||||
}
|
||||
|
||||
#user-info img:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { HeaderComponent } from './header.component';
|
||||
|
||||
describe('HeaderComponent', () => {
|
||||
let component: HeaderComponent;
|
||||
let fixture: ComponentFixture<HeaderComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ HeaderComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(HeaderComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,23 @@
|
||||
import {Component, OnInit} from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-header',
|
||||
templateUrl: './header.component.html',
|
||||
styleUrls: ['./header.component.scss']
|
||||
})
|
||||
export class HeaderComponent implements OnInit {
|
||||
|
||||
showProfilePopover: boolean = false;
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
}
|
||||
|
||||
openProfile(): void {
|
||||
console.log('Called');
|
||||
this.showProfilePopover = !this.showProfilePopover;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
<div id="profile-popover">
|
||||
<p>Test</p>
|
||||
</div>
|
||||
@@ -0,0 +1,13 @@
|
||||
@import '../../../styles';
|
||||
|
||||
#profile-popover {
|
||||
z-index: 1;
|
||||
position: fixed;
|
||||
right: 1em;
|
||||
top: $header_height + 1em;
|
||||
color: $text;
|
||||
background-color: $secondary;
|
||||
width: 15em;
|
||||
height: 20em;
|
||||
border-radius: 1em;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ProfileComponent } from './profile.component';
|
||||
|
||||
describe('ProfileComponent', () => {
|
||||
let component: ProfileComponent;
|
||||
let fixture: ComponentFixture<ProfileComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ ProfileComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(ProfileComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-profile',
|
||||
templateUrl: './profile.component.html',
|
||||
styleUrls: ['./profile.component.scss']
|
||||
})
|
||||
export class ProfileComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit(): void {
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user