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
37
src/components/messages/MessageIncoming.vue
Normal file
37
src/components/messages/MessageIncoming.vue
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
<template>
|
||||||
|
<!-- BASE CLASS FOR INCOMING MESSAGE -->
|
||||||
|
<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" />
|
||||||
|
<!-- SLOT FOR CONTENT -->
|
||||||
|
<slot></slot>
|
||||||
|
<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>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import messageMixin from "./messageMixin";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
mixins: [messageMixin],
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
@import "@/assets/css/chat.scss";
|
||||||
|
</style>
|
||||||
|
|
@ -1,35 +1,19 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="messageClasses">
|
<message-incoming v-bind="{...$props, ...$attrs}">
|
||||||
<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" />
|
|
||||||
<div class="audio-bubble">
|
<div class="audio-bubble">
|
||||||
<audio controls :src="src">Audio file</audio>
|
<audio controls :src="src">Audio file</audio>
|
||||||
</div>
|
</div>
|
||||||
<div class="op-button" ref="opbutton">
|
</message-incoming>
|
||||||
<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>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import messageMixin from "./messageMixin";
|
|
||||||
import attachmentMixin from "./attachmentMixin";
|
import attachmentMixin from "./attachmentMixin";
|
||||||
|
import MessageIncoming from './MessageIncoming.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [messageMixin, attachmentMixin],
|
extends: MessageIncoming,
|
||||||
|
mixins: [attachmentMixin],
|
||||||
|
components: { MessageIncoming }
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="messageClasses">
|
<message-incoming v-bind="{...$props, ...$attrs}">
|
||||||
<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" />
|
|
||||||
<div class="bubble">
|
<div class="bubble">
|
||||||
<div class="original-message" v-if="inReplyToText">
|
<div class="original-message" v-if="inReplyToText">
|
||||||
<div class="original-message-sender">
|
<div class="original-message-sender">
|
||||||
|
|
@ -28,27 +21,16 @@
|
||||||
>(edited)</span
|
>(edited)</span
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div>{{ JSON.stringify(event) }}</div> -->
|
|
||||||
</div>
|
</div>
|
||||||
<div class="op-button" ref="opbutton">
|
</message-incoming>
|
||||||
<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>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import messageMixin from "./messageMixin";
|
import MessageIncoming from "./MessageIncoming.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [messageMixin],
|
extends: MessageIncoming,
|
||||||
|
components: { MessageIncoming }
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="messageClasses">
|
<message-incoming v-bind="{...$props, ...$attrs}">
|
||||||
<v-avatar class="avatar" size="32" color="#ededed">
|
<div class="bubble image-bubble">
|
||||||
<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" />
|
|
||||||
<div class="bubble image-bubble">
|
|
||||||
<v-img
|
<v-img
|
||||||
:aspect-ratio="16 / 9"
|
:aspect-ratio="16 / 9"
|
||||||
ref="image"
|
ref="image"
|
||||||
|
|
@ -16,26 +9,16 @@
|
||||||
:contain="contain"
|
:contain="contain"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="op-button" ref="opbutton">
|
</message-incoming>
|
||||||
<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>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import messageMixin from "./messageMixin";
|
|
||||||
import util from "../../plugins/utils";
|
import util from "../../plugins/utils";
|
||||||
|
import MessageIncoming from './MessageIncoming.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [messageMixin],
|
extends: MessageIncoming,
|
||||||
|
components: { MessageIncoming },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
src: null,
|
src: null,
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="messageClasses">
|
<message-incoming v-bind="{ ...$props, ...$attrs }">
|
||||||
<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" />
|
|
||||||
<div class="bubble sticker-bubble">
|
<div class="bubble sticker-bubble">
|
||||||
<v-img
|
<v-img
|
||||||
:aspect-ratio="16 / 9"
|
:aspect-ratio="16 / 9"
|
||||||
|
|
@ -16,26 +9,16 @@
|
||||||
:contain="contain"
|
:contain="contain"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="op-button" ref="opbutton">
|
</message-incoming>
|
||||||
<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>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import messageMixin from "./messageMixin";
|
|
||||||
import stickers from "../../plugins/stickers";
|
import stickers from "../../plugins/stickers";
|
||||||
|
import MessageIncoming from "./MessageIncoming.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [messageMixin],
|
extends: MessageIncoming,
|
||||||
|
components: { MessageIncoming },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
src: null,
|
src: null,
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="messageClasses">
|
<message-incoming v-bind="{...$props, ...$attrs}">
|
||||||
<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" />
|
|
||||||
<div class="bubble">
|
<div class="bubble">
|
||||||
<div class="original-message" v-if="inReplyToText">
|
<div class="original-message" v-if="inReplyToText">
|
||||||
<div class="original-message-sender">
|
<div class="original-message-sender">
|
||||||
|
|
@ -25,24 +18,16 @@
|
||||||
</div>
|
</div>
|
||||||
<!-- <div>{{ JSON.stringify(event) }}</div> -->
|
<!-- <div>{{ JSON.stringify(event) }}</div> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="op-button" ref="opbutton">
|
</message-incoming>
|
||||||
<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>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import MessageIncoming from "./MessageIncoming.vue";
|
||||||
import messageMixin from "./messageMixin";
|
import messageMixin from "./messageMixin";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
extends: MessageIncoming,
|
||||||
|
components: { MessageIncoming },
|
||||||
mixins: [messageMixin],
|
mixins: [messageMixin],
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="messageClasses">
|
<message-incoming v-bind="{ ...$props, ...$attrs }">
|
||||||
<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" />
|
|
||||||
<div class="bubble image-bubble">
|
<div class="bubble image-bubble">
|
||||||
<v-responsive :aspect-ratio="16 / 9" :src="src">
|
<v-responsive :aspect-ratio="16 / 9" :src="src">
|
||||||
<video :src="src" controls style="width: 100%; height: 100%">
|
<video :src="src" controls style="width: 100%; height: 100%">
|
||||||
|
|
@ -19,26 +12,17 @@
|
||||||
</div>
|
</div>
|
||||||
</v-responsive>
|
</v-responsive>
|
||||||
</div>
|
</div>
|
||||||
<div class="op-button" ref="opbutton">
|
</message-incoming>
|
||||||
<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>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import messageMixin from "./messageMixin";
|
|
||||||
import attachmentMixin from "./attachmentMixin";
|
import attachmentMixin from "./attachmentMixin";
|
||||||
|
import MessageIncoming from "./MessageIncoming.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [messageMixin, attachmentMixin],
|
extends: MessageIncoming,
|
||||||
|
components: { MessageIncoming },
|
||||||
|
mixins: [attachmentMixin],
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
40
src/components/messages/MessageOutgoing.vue
Normal file
40
src/components/messages/MessageOutgoing.vue
Normal 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>
|
||||||
|
|
@ -1,39 +1,19 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="messageOut">
|
<message-outgoing v-bind="{ ...$props, ...$attrs }">
|
||||||
<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" />
|
|
||||||
<div class="audio-bubble">
|
<div class="audio-bubble">
|
||||||
<audio controls :src="src">Audio file</audio>
|
<audio controls :src="src">Audio file</audio>
|
||||||
</div>
|
</div>
|
||||||
<v-avatar
|
</message-outgoing>
|
||||||
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="senderAndTime">
|
|
||||||
<!-- <div class="sender">{{ "You" }}</div> -->
|
|
||||||
<div class="time">
|
|
||||||
{{ formatTime(event.event.origin_server_ts) }}
|
|
||||||
</div>
|
|
||||||
<div class="status">{{ event.status }}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import messageMixin from "./messageMixin";
|
|
||||||
import attachmentMixin from "./attachmentMixin";
|
import attachmentMixin from "./attachmentMixin";
|
||||||
|
import MessageOutgoing from "./MessageOutgoing.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [messageMixin, attachmentMixin],
|
extends: MessageOutgoing,
|
||||||
|
components: { MessageOutgoing },
|
||||||
|
mixins: [attachmentMixin],
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="messageOut">
|
<message-outgoing v-bind="{ ...$props, ...$attrs }">
|
||||||
<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" />
|
|
||||||
<div class="bubble">
|
<div class="bubble">
|
||||||
<div class="original-message" v-if="inReplyToText">
|
<div class="original-message" v-if="inReplyToText">
|
||||||
<div class="original-message-sender">
|
<div class="original-message-sender">
|
||||||
|
|
@ -29,30 +23,15 @@
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<v-avatar
|
</message-outgoing>
|
||||||
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>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import messageMixin from "./messageMixin";
|
import MessageOutgoing from "./MessageOutgoing.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [messageMixin],
|
extends: MessageOutgoing,
|
||||||
|
components: { MessageOutgoing },
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="messageOut">
|
<message-outgoing v-bind="{ ...$props, ...$attrs }">
|
||||||
<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" />
|
|
||||||
<div class="bubble image-bubble">
|
<div class="bubble image-bubble">
|
||||||
<v-img
|
<v-img
|
||||||
:aspect-ratio="16 / 9"
|
:aspect-ratio="16 / 9"
|
||||||
|
|
@ -15,31 +9,16 @@
|
||||||
:contain="contain"
|
:contain="contain"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<v-avatar
|
</message-outgoing>
|
||||||
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="senderAndTime">
|
|
||||||
<!-- <div class="sender">{{ "You" }}</div> -->
|
|
||||||
<div class="time">
|
|
||||||
{{ formatTime(event.event.origin_server_ts) }}
|
|
||||||
<div class="status">{{ event.status }}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import messageMixin from "./messageMixin";
|
|
||||||
import util from "../../plugins/utils";
|
import util from "../../plugins/utils";
|
||||||
|
import MessageOutgoing from "./MessageOutgoing.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [messageMixin],
|
extends: MessageOutgoing,
|
||||||
|
components: { MessageOutgoing },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
src: null,
|
src: null,
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="messageOut">
|
<message-outgoing v-bind="{ ...$props, ...$attrs }">
|
||||||
<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" />
|
|
||||||
<div class="bubble sticker-bubble">
|
<div class="bubble sticker-bubble">
|
||||||
<v-img
|
<v-img
|
||||||
:aspect-ratio="16 / 9"
|
:aspect-ratio="16 / 9"
|
||||||
|
|
@ -15,31 +9,16 @@
|
||||||
:contain="contain"
|
:contain="contain"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<v-avatar
|
</message-outgoing>
|
||||||
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="senderAndTime">
|
|
||||||
<!-- <div class="sender">{{ "You" }}</div> -->
|
|
||||||
<div class="time">
|
|
||||||
{{ formatTime(event.event.origin_server_ts) }}
|
|
||||||
<div class="status">{{ event.status }}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import messageMixin from "./messageMixin";
|
|
||||||
import stickers from "../../plugins/stickers";
|
import stickers from "../../plugins/stickers";
|
||||||
|
import MessageOutgoing from "./MessageOutgoing.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [messageMixin],
|
extends: MessageOutgoing,
|
||||||
|
components: { MessageOutgoing },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
src: null,
|
src: null,
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="messageOut">
|
<message-outgoing v-bind="{ ...$props, ...$attrs }">
|
||||||
<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" />
|
|
||||||
<div class="bubble">
|
<div class="bubble">
|
||||||
<div class="original-message" v-if="inReplyToText">
|
<div class="original-message" v-if="inReplyToText">
|
||||||
<div class="original-message-sender">
|
<div class="original-message-sender">
|
||||||
|
|
@ -24,30 +18,15 @@
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<v-avatar
|
</message-outgoing>
|
||||||
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>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import messageMixin from "./messageMixin";
|
import MessageOutgoing from "./MessageOutgoing.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [messageMixin],
|
extends: MessageOutgoing,
|
||||||
|
components: { MessageOutgoing },
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="messageOut">
|
<message-outgoing v-bind="{ ...$props, ...$attrs }">
|
||||||
<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" />
|
|
||||||
<div class="bubble image-bubble">
|
<div class="bubble image-bubble">
|
||||||
<v-responsive :aspect-ratio="16 / 9" class="ma-0 pa-0">
|
<v-responsive :aspect-ratio="16 / 9" class="ma-0 pa-0">
|
||||||
<video :src="src" controls style="width: 100%; height: 100%">
|
<video :src="src" controls style="width: 100%; height: 100%">
|
||||||
|
|
@ -13,31 +7,17 @@
|
||||||
</video>
|
</video>
|
||||||
</v-responsive>
|
</v-responsive>
|
||||||
</div>
|
</div>
|
||||||
<v-avatar
|
</message-outgoing>
|
||||||
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="senderAndTime">
|
|
||||||
<!-- <div class="sender">{{ "You" }}</div> -->
|
|
||||||
<div class="time">
|
|
||||||
{{ formatTime(event.event.origin_server_ts) }}
|
|
||||||
</div>
|
|
||||||
<div class="status">{{ event.status }}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import messageMixin from "./messageMixin";
|
|
||||||
import attachmentMixin from "./attachmentMixin";
|
import attachmentMixin from "./attachmentMixin";
|
||||||
|
import MessageOutgoing from "./MessageOutgoing.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [messageMixin, attachmentMixin],
|
extends: MessageOutgoing,
|
||||||
|
components: { MessageOutgoing },
|
||||||
|
mixins: [attachmentMixin],
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue