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:
N-Pex 2021-05-07 09:15:15 +02:00
parent 9b11f2274a
commit 601e0d4a6c
14 changed files with 142 additions and 288 deletions

View file

@ -0,0 +1,40 @@
<template>
<!-- BASE CLASS FOR OUTGOING MESSAGE -->
<div class="messageOut">
<div class="op-button" ref="opbutton">
<v-btn icon @click.stop="showContextMenu($refs.opbutton)"
><v-icon>more_vert</v-icon></v-btn
>
</div>
<QuickReactions :event="event" :reactions="reactions" />
<!-- SLOT FOR CONTENT -->
<slot></slot>
<v-avatar
class="avatar"
size="32"
color="#ededed"
@click.stop="ownAvatarClicked"
>
<img v-if="userAvatar" :src="userAvatar" />
<span v-else class="white--text headline">{{ userAvatarLetter }}</span>
</v-avatar>
<!-- <div class="sender">{{ "You" }}</div> -->
<div class="senderAndTime">
<div class="time">
{{ formatTime(event.event.origin_server_ts) }}
</div>
<div class="status">{{ event.status }}</div>
</div>
</div>
</template>
<script>
import messageMixin from "./messageMixin";
export default {
mixins: [messageMixin],
};
</script>
<style lang="scss">
@import "@/assets/css/chat.scss";
</style>