대화방 이름 옆에 직급 표시.(다국어 처리 안되있음)

This commit is contained in:
leejinho 2020-03-19 10:51:07 +09:00
parent 5fe7b9cb22
commit d8e48f7765
4 changed files with 18 additions and 3 deletions

View File

@ -98,9 +98,7 @@
<div class="message-main-container">
<div class="message-main">
<div class="chat-name">
{{ senderName }}
</div>
<div class="chat-name">{{ senderName }} {{ senderGrade }}</div>
<div class="bubble">
<ng-container

View File

@ -51,6 +51,9 @@ export class MessageBoxComponent implements OnInit, AfterViewInit {
@Input()
senderName: string;
@Input()
senderGrade: string;
@Input()
profileImageRoot: string;

View File

@ -66,6 +66,7 @@
"
[dateChanged]="getDateSplitter(message)"
[senderName]="getUserName(message.senderSeq)"
[senderGrade]="getUserGrade(message.senderSeq)"
[profileImageRoot]="profileImageRoot"
[profileImage]="getUserProfile(message.senderSeq)"
[roomInfo]="roomInfo"

View File

@ -322,6 +322,19 @@ export class MessagesComponent implements OnInit, OnDestroy {
}
return '(알수없는 사용자)';
}
getUserGrade(seq: number): string {
if (!this.userInfos) {
return '';
}
const userInfo: UserInfo[] = this.userInfos.filter(
user => user.seq === seq
);
if (!!userInfo && userInfo.length > 0) {
return userInfo[0].grade;
}
return '';
}
getUserProfile(seq: number): string {
if (!this.userInfos) {
return '';