logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://anongit.hacktivis.me/git/pleroma-fe.git/

chat_message.vue (3024B)


  1. <template>
  2. <div
  3. v-if="isMessage"
  4. class="chat-message-wrapper"
  5. :class="{ 'hovered-message-chain': hoveredMessageChain }"
  6. @mouseover="onHover(true)"
  7. @mouseleave="onHover(false)"
  8. >
  9. <div
  10. class="chat-message"
  11. :class="[{ 'outgoing': isCurrentUser, 'incoming': !isCurrentUser }]"
  12. >
  13. <div
  14. v-if="!isCurrentUser"
  15. class="avatar-wrapper"
  16. >
  17. <UserPopover
  18. v-if="chatViewItem.isHead"
  19. :user-id="author.id"
  20. >
  21. <UserAvatar
  22. :compact="true"
  23. :better-shadow="betterShadow"
  24. :user="author"
  25. />
  26. </UserPopover>
  27. </div>
  28. <div class="chat-message-inner">
  29. <div
  30. class="status-body"
  31. :style="{ 'min-width': message.attachment ? '80%' : '' }"
  32. >
  33. <div
  34. class="media status"
  35. :class="{ 'without-attachment': !hasAttachment, 'pending': chatViewItem.data.pending, 'error': chatViewItem.data.error }"
  36. style="position: relative;"
  37. @mouseenter="hovered = true"
  38. @mouseleave="hovered = false"
  39. >
  40. <div
  41. class="chat-message-menu"
  42. :class="{ 'visible': hovered || menuOpened }"
  43. >
  44. <Popover
  45. trigger="click"
  46. placement="top"
  47. bound-to-selector=".chat-view-inner"
  48. :bound-to="{ x: 'container' }"
  49. :margin="popoverMarginStyle"
  50. @show="menuOpened = true"
  51. @close="menuOpened = false"
  52. >
  53. <template #content>
  54. <div class="dropdown-menu">
  55. <button
  56. class="menu-item dropdown-item dropdown-item-icon"
  57. @click="deleteMessage"
  58. >
  59. <FAIcon icon="times" /> {{ $t("chats.delete") }}
  60. </button>
  61. </div>
  62. </template>
  63. <template #trigger>
  64. <button
  65. class="button-default menu-icon"
  66. :title="$t('chats.more')"
  67. >
  68. <FAIcon icon="ellipsis-h" />
  69. </button>
  70. </template>
  71. </Popover>
  72. </div>
  73. <StatusContent
  74. class="message-content"
  75. :status="messageForStatusContent"
  76. :full-content="true"
  77. >
  78. <template #footer>
  79. <span
  80. class="created-at"
  81. >
  82. {{ createdAt }}
  83. </span>
  84. </template>
  85. </StatusContent>
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. <div
  92. v-else
  93. class="chat-message-date-separator"
  94. >
  95. <ChatMessageDate :date="chatViewItem.date" />
  96. </div>
  97. </template>
  98. <script src="./chat_message.js"></script>
  99. <style lang="scss">
  100. @import "./chat_message";
  101. </style>