56 lines
1.4 KiB
TypeScript
Raw Normal View History

import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { RightDrawer } from '@app/types';
2020-01-15 14:23:55 +09:00
import { TranslateService } from '@ngx-translate/core';
@Component({
selector: 'app-layout-messenger-right-drawer',
templateUrl: './right-drawer.component.html',
styleUrls: ['./right-drawer.component.scss']
})
export class RightDrawerComponent implements OnInit {
@Input()
selectedRightDrawer: RightDrawer;
@Output()
openProfile = new EventEmitter<{
userSeq: number;
}>();
@Output()
closeRightDrawer = new EventEmitter();
RightDrawer = RightDrawer;
2020-01-15 14:23:55 +09:00
constructor(private translateService: TranslateService) {}
ngOnInit() {}
onClickOpenProfile(userSeq: number) {
this.openProfile.emit({ userSeq });
}
onClickClose() {
this.closeRightDrawer.emit();
}
2020-01-15 14:23:55 +09:00
getTitle(): string {
let rtnStr = '';
switch (this.selectedRightDrawer) {
case RightDrawer.AlbumBox:
rtnStr = this.translateService.instant('chat.albumBox.label');
break;
case RightDrawer.FileBox:
rtnStr = this.translateService.instant('chat.fileBox.label');
break;
case RightDrawer.RoomUser:
rtnStr = this.translateService.instant('chat.listOfRoomMember');
break;
case RightDrawer.Notice:
rtnStr = this.translateService.instant('notice.label');
break;
}
return rtnStr;
}
}