Add start of user/account menu
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
<div *ngIf="user">
|
||||
<span class="rounded-circle menu-button" [title]="user.name">{{getLetter()}}</span>
|
||||
</div>
|
@@ -0,0 +1,10 @@
|
||||
.menu-button {
|
||||
background-color: purple;
|
||||
color:white;
|
||||
display: inline-block;
|
||||
width: 2.5em;
|
||||
height: 2.5em;
|
||||
line-height: 2.5em;
|
||||
text-align: center;
|
||||
font-size: 1rem;
|
||||
}
|
@@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { UserMenuComponent } from './user-menu.component';
|
||||
|
||||
describe('UserMenuComponent', () => {
|
||||
let component: UserMenuComponent;
|
||||
let fixture: ComponentFixture<UserMenuComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ UserMenuComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(UserMenuComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@@ -0,0 +1,21 @@
|
||||
import { Component, OnInit,Input } from '@angular/core';
|
||||
import { IUser } from '../../models/user';
|
||||
|
||||
@Component({
|
||||
selector: 'fm-user-menu',
|
||||
templateUrl: './user-menu.component.html',
|
||||
styleUrls: ['./user-menu.component.scss']
|
||||
})
|
||||
export class UserMenuComponent implements OnInit {
|
||||
|
||||
@Input() user:IUser;
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit(): void {
|
||||
}
|
||||
|
||||
getLetter():string {
|
||||
return this.user.name ? this.user.name.substr(0,1).toUpperCase():"";
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user