Skip to content

Commit

Permalink
Fixes to ctzn-community-members-list
Browse files Browse the repository at this point in the history
  • Loading branch information
pfrazee committed May 5, 2021
1 parent d420bd6 commit 494fb28
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion static/js/com/members-list.js
Expand Up @@ -52,7 +52,7 @@ export class MembersList extends LitElement {
return html`
<div class="flex items-center px-2 py-2 border-t border-gray-200">
<a class="ml-1 mr-3" href="/${userId}" title=${userId}>
<img class="block rounded-md w-10 h-10 object-cover shadow-sm" src=${AVATAR_URL(userId)}>
<img class="lazyload block rounded-md w-10 h-10 object-cover shadow-sm" data-src=${AVATAR_URL(userId)}>
</a>
<div class="flex-1 min-w-0">
<div class="truncate">
Expand Down
13 changes: 13 additions & 0 deletions static/js/ctzn-tags/community-members-list.js
@@ -1,5 +1,6 @@
import { LitElement, html } from '../../vendor/lit/lit.min.js'
import { repeat } from '../../vendor/lit/directives/repeat.js'
import { BanPopup } from '../com/popups/ban.js'
import { intersect } from '../lib/functions.js'
import * as session from '../lib/session.js'
import { AVATAR_URL } from '../lib/const.js'
Expand Down Expand Up @@ -142,6 +143,18 @@ export class CommunityMembersList extends LitElement {
onToggleExpanded (e) {
this.isExpanded = !this.isExpanded
}

async onBan (e) {
try {
await BanPopup.create({
communityId: this.userId,
member: e.detail.member
})
this.load()
} catch (e) {
// ignore
}
}
}

customElements.define('ctzn-community-members-list', CommunityMembersList)

1 comment on commit 494fb28

@vercel
Copy link

@vercel vercel bot commented on 494fb28 May 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.