mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 01:56:58 +08:00
DEV: Convert components to gjs
- convert chat/channels-list -> gjs - convert chat/chat-channel-archive-status -> gjs - convert chat/chat-channel-card -> gjs - convert chat/chat-channel-leave-btn -> gjs - convert chat/chat-channel-metadata -> gjs - convert chat/chat-channel-preview-card -> gjs - convert chat/chat-channel-status -> gjs - convert chat/chat-channel-unread-indicator -> gjs - convert chat/chat-composer-dropdown -> gjs - convert chat/chat-composer-message-details -> gjs - convert chat/chat-composer-upload -> gjs - convert chat/channel -> gjs - convert chat/header -> gjs - convert chat/back-link -> gjs - convert chat/channel-title -> gjs - convert chat/close-button -> gjs - convert chat/full-page-button -> gjs - convert chat/left-actions -> gjs - convert chat/right-actions -> gjs - convert chat/toggle-expand-button -> gjs - convert chat/index -> gjs - convert chat/chat-emoji-avatar -> gjs - convert chat/chat-mention-warnings -> gjs - convert chat/chat-message-in-reply-to-indicator -> gjs - convert chat/chat-message-separator-date -> gjs - convert chat/chat-message-separator-new -> gjs - convert chat/chat-message-text -> gjs - convert chat/chat-message-thread-indicator -> gjs - convert chat/chat-notice -> gjs - convert chat/chat-notices -> gjs - convert chat/chat-replying-indicator -> gjs - convert chat/chat-side-panel-resizer -> gjs - convert chat/chat-side-panel -> gjs - convert chat/chat-skeleton -> gjs - convert chat/chat-upload-drop-zone -> gjs - convert chat/chat-upload -> gjs - convert chat/chat-user-display-name -> gjs - convert chat/export-messages -> gjs - convert chat/button -> gjs - convert chat/separator -> gjs - convert chat/avatar -> gjs - convert chat/error -> gjs - convert chat/info -> gjs - convert chat/left-gutter -> gjs - convert chat/archive-channel -> gjs - convert chat/channel-summary -> gjs - convert chat/delete-channel -> gjs - convert chat/edit-channel-name -> gjs - convert chat/move-message-to-channel -> gjs - convert chat/thread-settings -> gjs - convert chat/toggle-channel-status -> gjs - convert chat/mention_without_membership -> gjs - convert chat/scroll-to-bottom-arrow -> gjs - convert chat/item -> gjs - convert chat/unread-indicator -> gjs - convert chat/user-card-button -> gjs - convert chat/full-page-chat -> gjs - convert chat/reviewable-chat-message -> gjs - convert chat/chat -> gjs - convert chat/toggle-channel-membership-button -> gjs - convert chat/chat-preferences -> gjs
This commit is contained in:

committed by
David Taylor

parent
e1f74fcb4b
commit
3a0cdd2734
@ -1,8 +1,17 @@
|
||||
import Component from "@glimmer/component";
|
||||
import { tracked } from "@glimmer/tracking";
|
||||
import { action } from "@ember/object";
|
||||
import didInsert from "@ember/render-modifiers/modifiers/did-insert";
|
||||
import willDestroy from "@ember/render-modifiers/modifiers/will-destroy";
|
||||
import { inject as service } from "@ember/service";
|
||||
import concatClass from "discourse/helpers/concat-class";
|
||||
import formatDate from "discourse/helpers/format-date";
|
||||
import replaceEmoji from "discourse/helpers/replace-emoji";
|
||||
import htmlSafe from "discourse-common/helpers/html-safe";
|
||||
import i18n from "discourse-common/helpers/i18n";
|
||||
import { bind } from "discourse-common/utils/decorators";
|
||||
import ChatThreadParticipants from "./chat-thread-participants";
|
||||
import ChatUserAvatar from "./chat-user-avatar";
|
||||
|
||||
export default class ChatMessageThreadIndicator extends Component {
|
||||
@service capabilities;
|
||||
@ -83,4 +92,44 @@ export default class ChatMessageThreadIndicator extends Component {
|
||||
...this.args.message.thread.routeModels
|
||||
);
|
||||
}
|
||||
|
||||
<template>
|
||||
<div
|
||||
class={{concatClass
|
||||
"chat-message-thread-indicator"
|
||||
(if this.isActive "-active")
|
||||
}}
|
||||
{{didInsert this.setup}}
|
||||
{{willDestroy this.teardown}}
|
||||
role="button"
|
||||
title={{i18n "chat.threads.open"}}
|
||||
>
|
||||
|
||||
<div class="chat-message-thread-indicator__last-reply-avatar">
|
||||
<ChatUserAvatar
|
||||
@user={{@message.thread.preview.lastReplyUser}}
|
||||
@avatarSize="small"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="chat-message-thread-indicator__last-reply-info">
|
||||
<span class="chat-message-thread-indicator__last-reply-username">
|
||||
{{@message.thread.preview.lastReplyUser.username}}
|
||||
</span>
|
||||
<span class="chat-message-thread-indicator__last-reply-timestamp">
|
||||
{{formatDate
|
||||
@message.thread.preview.lastReplyCreatedAt
|
||||
leaveAgo="true"
|
||||
}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="chat-message-thread-indicator__replies-count">
|
||||
{{i18n "chat.thread.replies" count=@message.thread.preview.replyCount}}
|
||||
</div>
|
||||
<ChatThreadParticipants @thread={{@message.thread}} />
|
||||
<div class="chat-message-thread-indicator__last-reply-excerpt">
|
||||
{{replaceEmoji (htmlSafe @message.thread.preview.lastReplyExcerpt)}}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
}
|
||||
|
Reference in New Issue
Block a user