logo

pleroma-fe

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

chat.vue (2914B)


  1. <template>
  2. <div class="chat-view">
  3. <div class="chat-view-inner">
  4. <div
  5. ref="inner"
  6. class="panel-default panel chat-view-body"
  7. >
  8. <div
  9. ref="header"
  10. class="panel-heading -sticky chat-view-heading"
  11. >
  12. <button
  13. class="button-unstyled go-back-button"
  14. @click="goBack"
  15. >
  16. <FAIcon
  17. size="lg"
  18. icon="chevron-left"
  19. />
  20. </button>
  21. <div class="title text-center">
  22. <ChatTitle
  23. :user="recipient"
  24. :with-avatar="true"
  25. />
  26. </div>
  27. </div>
  28. <div
  29. class="chat-message-list message-list"
  30. :style="{ height: scrollableContainerHeight }"
  31. >
  32. <template v-if="!errorLoadingChat">
  33. <ChatMessage
  34. v-for="chatViewItem in chatViewItems"
  35. :key="chatViewItem.id"
  36. :author="recipient"
  37. :chat-view-item="chatViewItem"
  38. :hovered-message-chain="chatViewItem.messageChainId === hoveredMessageChainId"
  39. @hover="onMessageHover"
  40. />
  41. </template>
  42. <div
  43. v-else
  44. class="chat-loading-error"
  45. >
  46. <div class="alert error">
  47. {{ $t('chats.error_loading_chat') }}
  48. </div>
  49. </div>
  50. </div>
  51. <div
  52. ref="footer"
  53. class="panel-body footer"
  54. >
  55. <div
  56. class="jump-to-bottom-button"
  57. :class="{ 'visible': jumpToBottomButtonVisible }"
  58. @click="scrollDown({ behavior: 'smooth' })"
  59. >
  60. <span>
  61. <FAIcon icon="chevron-down" />
  62. <div
  63. v-if="newMessageCount"
  64. class="badge -notification unread-chat-count unread-message-count"
  65. >
  66. {{ newMessageCount }}
  67. </div>
  68. </span>
  69. </div>
  70. <PostStatusForm
  71. :disable-subject="true"
  72. :disable-scope-selector="true"
  73. :disable-notice="true"
  74. :disable-lock-warning="true"
  75. :disable-polls="true"
  76. :disable-sensitivity-checkbox="true"
  77. :disable-submit="errorLoadingChat || !currentChat"
  78. :disable-preview="true"
  79. :optimistic-posting="true"
  80. :post-handler="sendMessage"
  81. :submit-on-enter="!mobileLayout"
  82. :preserve-focus="!mobileLayout"
  83. :auto-focus="!mobileLayout"
  84. :placeholder="formPlaceholder"
  85. :file-limit="1"
  86. max-height="160"
  87. emoji-picker-placement="top"
  88. @resize="handleResize"
  89. />
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. </template>
  95. <script src="./chat.js"></script>
  96. <style lang="scss">
  97. @import "./chat";
  98. </style>