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 (3054B)


  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. :user="author"
  24. />
  25. </UserPopover>
  26. </div>
  27. <div class="chat-message-inner">
  28. <div
  29. class="status-body"
  30. :style="{ 'min-width': message.attachment ? '80%' : '' }"
  31. >
  32. <div
  33. class="media status"
  34. :class="{ 'without-attachment': !hasAttachment, 'pending': chatViewItem.data.pending, 'error': chatViewItem.data.error }"
  35. style="position: relative;"
  36. @mouseenter="hovered = true"
  37. @mouseleave="hovered = false"
  38. >
  39. <div
  40. class="chat-message-menu"
  41. :class="{ 'visible': hovered || menuOpened }"
  42. >
  43. <Popover
  44. trigger="click"
  45. placement="top"
  46. bound-to-selector=".chat-view-inner"
  47. :bound-to="{ x: 'container' }"
  48. :margin="popoverMarginStyle"
  49. @show="menuOpened = true"
  50. @close="menuOpened = false"
  51. >
  52. <template #content>
  53. <div class="dropdown-menu">
  54. <div class="menu-item dropdown-item -icon">
  55. <button
  56. class="main-button"
  57. @click="deleteMessage"
  58. >
  59. <FAIcon icon="times" /> {{ $t("chats.delete") }}
  60. </button>
  61. </div>
  62. </div>
  63. </template>
  64. <template #trigger>
  65. <button
  66. class="button-default menu-icon"
  67. :title="$t('chats.more')"
  68. >
  69. <FAIcon icon="ellipsis-h" />
  70. </button>
  71. </template>
  72. </Popover>
  73. </div>
  74. <StatusContent
  75. class="message-content"
  76. :status="messageForStatusContent"
  77. :full-content="true"
  78. >
  79. <template #footer>
  80. <span
  81. class="created-at"
  82. >
  83. {{ createdAt }}
  84. </span>
  85. </template>
  86. </StatusContent>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. </div>
  92. <div
  93. v-else
  94. class="chat-message-date-separator"
  95. >
  96. <ChatMessageDate :date="chatViewItem.date" />
  97. </div>
  98. </template>
  99. <script src="./chat_message.js"></script>
  100. <style lang="scss">
  101. @import "./chat_message";
  102. </style>