Use base classes for message types
This avoids unnecessary duplication of code for "avatar", "sender" etc in the general layout of messages.
This commit is contained in:
parent
9b11f2274a
commit
601e0d4a6c
14 changed files with 142 additions and 288 deletions
|
|
@ -1,12 +1,5 @@
|
|||
<template>
|
||||
<div :class="messageClasses">
|
||||
<v-avatar class="avatar" size="32" color="#ededed">
|
||||
<img v-if="messageEventAvatar(event)" :src="messageEventAvatar(event)" />
|
||||
<span v-else class="white--text headline">{{
|
||||
messageEventDisplayName(event).substring(0, 1).toUpperCase()
|
||||
}}</span>
|
||||
</v-avatar>
|
||||
<QuickReactions :event="event" :reactions="reactions" />
|
||||
<message-incoming v-bind="{ ...$props, ...$attrs }">
|
||||
<div class="bubble sticker-bubble">
|
||||
<v-img
|
||||
:aspect-ratio="16 / 9"
|
||||
|
|
@ -16,26 +9,16 @@
|
|||
:contain="contain"
|
||||
/>
|
||||
</div>
|
||||
<div class="op-button" ref="opbutton">
|
||||
<v-btn icon @click.stop="showContextMenu($refs.opbutton)"
|
||||
><v-icon>more_vert</v-icon></v-btn
|
||||
>
|
||||
</div>
|
||||
<div v-if="showSenderAndTime" class="senderAndTime">
|
||||
<div class="sender">{{ messageEventDisplayName(event) }}</div>
|
||||
<div class="time">
|
||||
{{ formatTime(event.event.origin_server_ts) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</message-incoming>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import messageMixin from "./messageMixin";
|
||||
import stickers from "../../plugins/stickers";
|
||||
import MessageIncoming from "./MessageIncoming.vue";
|
||||
|
||||
export default {
|
||||
mixins: [messageMixin],
|
||||
extends: MessageIncoming,
|
||||
components: { MessageIncoming },
|
||||
data() {
|
||||
return {
|
||||
src: null,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue