feat(dashboard): add options menu and improve layout
This commit is contained in:
parent
56cb68a3ce
commit
ba520eea10
7 changed files with 84 additions and 20 deletions
0
src/app/options-menu/options-menu.component.css
Normal file
0
src/app/options-menu/options-menu.component.css
Normal file
9
src/app/options-menu/options-menu.component.html
Normal file
9
src/app/options-menu/options-menu.component.html
Normal file
|
@ -0,0 +1,9 @@
|
|||
<button mat-icon-button [matMenuTriggerFor]="menu" aria-label="Example icon-button with a menu">
|
||||
<mat-icon>more_vert</mat-icon>
|
||||
</button>
|
||||
<mat-menu #menu="matMenu">
|
||||
<button (click)="logout()" mat-menu-item>
|
||||
<mat-icon>logout</mat-icon>
|
||||
<span>Logout</span>
|
||||
</button>
|
||||
</mat-menu>
|
23
src/app/options-menu/options-menu.component.spec.ts
Normal file
23
src/app/options-menu/options-menu.component.spec.ts
Normal file
|
@ -0,0 +1,23 @@
|
|||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { OptionsMenuComponent } from './options-menu.component';
|
||||
|
||||
describe('OptionsMenuComponent', () => {
|
||||
let component: OptionsMenuComponent;
|
||||
let fixture: ComponentFixture<OptionsMenuComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [OptionsMenuComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(OptionsMenuComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
19
src/app/options-menu/options-menu.component.ts
Normal file
19
src/app/options-menu/options-menu.component.ts
Normal file
|
@ -0,0 +1,19 @@
|
|||
import { Component } from '@angular/core';
|
||||
import {MatIconModule} from '@angular/material/icon';
|
||||
import {MatMenuModule} from '@angular/material/menu';
|
||||
import {MatButtonModule} from '@angular/material/button';
|
||||
import { LogoutService } from '../service/logout.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-options-menu',
|
||||
imports: [MatIconModule, MatMenuModule, MatButtonModule],
|
||||
templateUrl: './options-menu.component.html',
|
||||
styleUrl: './options-menu.component.css'
|
||||
})
|
||||
export class OptionsMenuComponent {
|
||||
constructor(private logoutService: LogoutService) {}
|
||||
|
||||
logout() {
|
||||
this.logoutService.logout();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue