29 lines
812 B
TypeScript
Raw Normal View History

2019-10-14 15:34:00 +09:00
import { Component, OnInit, Input } from '@angular/core';
2019-11-06 13:48:06 +09:00
import { Info, StickerEventJson } from '@ucap-webmessenger/protocol-event';
2019-10-14 15:34:00 +09:00
import { NGXLogger } from 'ngx-logger';
import { StickerInfo } from '../../models/sticker-info.json';
2019-10-07 13:49:12 +09:00
@Component({
selector: 'ucap-chat-message-box-sticker',
templateUrl: './sticker.component.html',
styleUrls: ['./sticker.component.scss']
})
export class StickerComponent implements OnInit {
2019-10-14 15:34:00 +09:00
@Input()
2019-11-06 13:48:06 +09:00
message: Info<StickerEventJson>;
2019-10-07 13:49:12 +09:00
2019-10-14 15:34:00 +09:00
contentJson?: StickerInfo;
stickerUrl?: string;
constructor(private logger: NGXLogger) {}
ngOnInit() {
try {
2019-11-06 13:48:06 +09:00
if (!!this.message.sentMessageJson.file) {
this.stickerUrl = `assets/sticker/sticker_s_${this.message.sentMessageJson.file}.png`;
2019-10-14 15:34:00 +09:00
}
} catch (e) {
this.logger.error(e);
}
}
2019-10-07 13:49:12 +09:00
}