mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 01:14:29 +08:00
FEATURE: Add user status to chat members list (#25831)
This change adds the user status next to the name within the chat channel members list.
This commit is contained in:
@ -30,7 +30,6 @@ export default class ChatUserDisplayName extends Component {
|
||||
<span class="chat-user-display-name">
|
||||
{{#if this.shouldShowNameFirst}}
|
||||
<span class="chat-user-display-name__name -first">{{@user.name}}</span>
|
||||
<span class="separator">—</span>
|
||||
{{/if}}
|
||||
|
||||
<span
|
||||
@ -43,7 +42,6 @@ export default class ChatUserDisplayName extends Component {
|
||||
</span>
|
||||
|
||||
{{#if this.shouldShowNameLast}}
|
||||
<span class="separator">—</span>
|
||||
<span class="chat-user-display-name__name">{{@user.name}}</span>
|
||||
{{/if}}
|
||||
</span>
|
||||
|
@ -1,4 +1,5 @@
|
||||
import Component from "@glimmer/component";
|
||||
import UserStatusMessage from "discourse/components/user-status-message";
|
||||
import { userPath } from "discourse/lib/url";
|
||||
import ChatUserAvatar from "discourse/plugins/chat/discourse/components/chat-user-avatar";
|
||||
import ChatUserDisplayName from "discourse/plugins/chat/discourse/components/chat-user-display-name";
|
||||
@ -16,6 +17,14 @@ export default class ChatUserInfo extends Component {
|
||||
return this.args.interactive ?? false;
|
||||
}
|
||||
|
||||
get showStatus() {
|
||||
return this.args.showStatus ?? false;
|
||||
}
|
||||
|
||||
get showStatusDescription() {
|
||||
return this.args.showStatusDescription ?? false;
|
||||
}
|
||||
|
||||
<template>
|
||||
{{#if @user}}
|
||||
<ChatUserAvatar
|
||||
@ -31,6 +40,13 @@ export default class ChatUserInfo extends Component {
|
||||
{{else}}
|
||||
<ChatUserDisplayName @user={{@user}} />
|
||||
{{/if}}
|
||||
|
||||
{{#if this.showStatus}}
|
||||
<UserStatusMessage
|
||||
@status={{@user.status}}
|
||||
@showDescription={{this.showStatusDescription}}
|
||||
/>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</template>
|
||||
}
|
||||
|
@ -176,6 +176,8 @@ export default class ChatRouteChannelInfoMembers extends Component {
|
||||
@user={{membership.user}}
|
||||
@avatarSize="tiny"
|
||||
@interactive={{false}}
|
||||
@showStatus={{true}}
|
||||
@showStatusDescription={{true}}
|
||||
/>
|
||||
</li>
|
||||
{{else}}
|
||||
|
Reference in New Issue
Block a user