2019-11-12 18:10:38 +09:00
|
|
|
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
|
2019-11-11 14:31:26 +09:00
|
|
|
import { RightDrawer } from '@app/types';
|
2020-01-15 14:23:55 +09:00
|
|
|
import { TranslateService } from '@ngx-translate/core';
|
2019-11-11 14:31:26 +09:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'app-layout-messenger-right-drawer',
|
|
|
|
templateUrl: './right-drawer.component.html',
|
2019-12-26 17:34:52 +09:00
|
|
|
styleUrls: ['./right-drawer.component.scss']
|
2019-11-11 14:31:26 +09:00
|
|
|
})
|
|
|
|
export class RightDrawerComponent implements OnInit {
|
|
|
|
@Input()
|
|
|
|
selectedRightDrawer: RightDrawer;
|
|
|
|
|
2019-11-12 18:10:38 +09:00
|
|
|
@Output()
|
2019-12-26 17:34:52 +09:00
|
|
|
openProfile = new EventEmitter<{
|
2020-01-02 15:58:16 +09:00
|
|
|
userSeq: number;
|
2019-12-26 17:34:52 +09:00
|
|
|
}>();
|
2019-11-13 11:06:13 +09:00
|
|
|
@Output()
|
|
|
|
closeRightDrawer = new EventEmitter();
|
2019-11-12 18:10:38 +09:00
|
|
|
|
2019-11-11 14:31:26 +09:00
|
|
|
RightDrawer = RightDrawer;
|
|
|
|
|
2020-01-15 14:23:55 +09:00
|
|
|
constructor(private translateService: TranslateService) {}
|
2019-11-11 14:31:26 +09:00
|
|
|
|
|
|
|
ngOnInit() {}
|
2019-11-12 18:10:38 +09:00
|
|
|
|
2020-01-02 15:58:16 +09:00
|
|
|
onClickOpenProfile(userSeq: number) {
|
|
|
|
this.openProfile.emit({ userSeq });
|
2019-11-12 18:10:38 +09:00
|
|
|
}
|
2019-11-13 11:06:13 +09:00
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
2019-11-11 14:31:26 +09:00
|
|
|
}
|