2020-05-07 06:10:53 -07:00
|
|
|
<template>
|
|
|
|
<div
|
|
|
|
v-if="isMessage"
|
|
|
|
class="chat-message-wrapper"
|
|
|
|
:class="{ 'hovered-message-chain': hoveredMessageChain }"
|
|
|
|
@mouseover="onHover(true)"
|
|
|
|
@mouseleave="onHover(false)"
|
|
|
|
>
|
|
|
|
<div
|
|
|
|
class="chat-message"
|
|
|
|
:class="[{ 'outgoing': isCurrentUser, 'incoming': !isCurrentUser }]"
|
|
|
|
>
|
|
|
|
<div
|
|
|
|
v-if="!isCurrentUser"
|
|
|
|
class="avatar-wrapper"
|
|
|
|
>
|
|
|
|
<router-link
|
|
|
|
v-if="chatViewItem.isHead"
|
|
|
|
:to="userProfileLink"
|
|
|
|
>
|
|
|
|
<UserAvatar
|
|
|
|
:compact="true"
|
|
|
|
:better-shadow="betterShadow"
|
|
|
|
:user="author"
|
|
|
|
/>
|
|
|
|
</router-link>
|
|
|
|
</div>
|
|
|
|
<div class="chat-message-inner">
|
|
|
|
<div
|
|
|
|
class="status-body"
|
|
|
|
:style="{ 'min-width': message.attachment ? '80%' : '' }"
|
|
|
|
>
|
|
|
|
<div
|
|
|
|
class="media status"
|
2020-10-29 03:33:06 -07:00
|
|
|
:class="{ 'without-attachment': !hasAttachment, 'pending': chatViewItem.data.pending, 'error': chatViewItem.data.error }"
|
2020-05-07 06:10:53 -07:00
|
|
|
style="position: relative"
|
|
|
|
@mouseenter="hovered = true"
|
|
|
|
@mouseleave="hovered = false"
|
|
|
|
>
|
|
|
|
<div
|
|
|
|
class="chat-message-menu"
|
2020-07-07 11:43:46 -07:00
|
|
|
:class="{ 'visible': hovered || menuOpened }"
|
2020-05-07 06:10:53 -07:00
|
|
|
>
|
|
|
|
<Popover
|
|
|
|
trigger="click"
|
|
|
|
placement="top"
|
|
|
|
:bound-to-selector="isCurrentUser ? '' : '.scrollable-message-list'"
|
|
|
|
:bound-to="{ x: 'container' }"
|
|
|
|
:margin="popoverMarginStyle"
|
|
|
|
@show="menuOpened = true"
|
|
|
|
@close="menuOpened = false"
|
|
|
|
>
|
2021-04-07 12:42:34 -07:00
|
|
|
<template v-slot:content>
|
2020-05-07 06:10:53 -07:00
|
|
|
<div class="dropdown-menu">
|
|
|
|
<button
|
2020-11-24 02:32:42 -08:00
|
|
|
class="button-default dropdown-item dropdown-item-icon"
|
2020-05-07 06:10:53 -07:00
|
|
|
@click="deleteMessage"
|
|
|
|
>
|
2020-10-20 11:18:23 -07:00
|
|
|
<FAIcon icon="times" /> {{ $t("chats.delete") }}
|
2020-05-07 06:10:53 -07:00
|
|
|
</button>
|
|
|
|
</div>
|
2021-04-07 12:42:34 -07:00
|
|
|
</template>
|
|
|
|
<template v-slot:trigger>
|
|
|
|
<button
|
|
|
|
class="button-default menu-icon"
|
|
|
|
:title="$t('chats.more')"
|
|
|
|
>
|
|
|
|
<FAIcon icon="ellipsis-h" />
|
|
|
|
</button>
|
|
|
|
</template>
|
2020-05-07 06:10:53 -07:00
|
|
|
</Popover>
|
|
|
|
</div>
|
|
|
|
<StatusContent
|
2021-06-07 09:50:26 -07:00
|
|
|
class="message-content"
|
2020-05-07 06:10:53 -07:00
|
|
|
:status="messageForStatusContent"
|
|
|
|
:full-content="true"
|
|
|
|
>
|
2021-04-07 12:42:34 -07:00
|
|
|
<template v-slot:footer>
|
|
|
|
<span
|
|
|
|
class="created-at"
|
|
|
|
>
|
|
|
|
{{ createdAt }}
|
|
|
|
</span>
|
|
|
|
</template>
|
2020-05-07 06:10:53 -07:00
|
|
|
</StatusContent>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div
|
|
|
|
v-else
|
|
|
|
class="chat-message-date-separator"
|
|
|
|
>
|
|
|
|
<ChatMessageDate :date="chatViewItem.date" />
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script src="./chat_message.js" ></script>
|
|
|
|
<style lang="scss">
|
|
|
|
@import './chat_message.scss';
|
|
|
|
|
|
|
|
</style>
|