forked from vhaudiquet/rhema-together
feat(web): list the room's people and let the owner remove them
The invite dialog was reachable only from the invite button, and who was in the room showed only as avatars in the top bar. Selecting an avatar, the member count, or the People button now opens one dialog: a scrollable member list with the invite link below it. The owner removes a member from the row after a confirmation, and the top bar drops them without reloading the room. The server already refuses to remove the owner. Invite link creation is unchanged.
This commit is contained in:
1 parent
7d98b04d63
commit
880f4e2d87
5 files changed
+295
-100
No files matched your search
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { PanelRight, PanelRightClose, Settings, UserPlus } from 'lucide-vue-next'
|
||||
import { PanelRight, PanelRightClose, Settings, Users } from 'lucide-vue-next'
|
||||
import type { Member } from '~/types'
|
||||
|
||||
const props = defineProps<{
|
||||
@@ -11,7 +11,7 @@ const props = defineProps<{
|
||||
paneOpen: boolean
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{ invite: []; togglePane: []; settings: [] }>()
|
||||
const emit = defineEmits<{ people: []; togglePane: []; settings: [] }>()
|
||||
|
||||
const online = computed(() => new Set(props.onlineIds))
|
||||
|
||||
@@ -32,26 +32,43 @@ const extraTitle = computed(() => extra.value.map((member) => member.display_nam
|
||||
|
||||
<div class="presence">
|
||||
<div class="presence-avatars" aria-label="Room members">
|
||||
<AppAvatar
|
||||
<button
|
||||
v-for="member in visible"
|
||||
:key="member.id"
|
||||
:name="member.display_name"
|
||||
:color="member.color"
|
||||
:src="avatarUrl(member)"
|
||||
:offline="!online.has(member.id)"
|
||||
size="sm"
|
||||
/>
|
||||
<span v-if="extra.length > 0" class="small muted" :title="extraTitle">+{{ extra.length }}</span>
|
||||
type="button"
|
||||
class="avatar-btn"
|
||||
:aria-label="`Show people, ${member.display_name}`"
|
||||
@click="emit('people')"
|
||||
>
|
||||
<AppAvatar
|
||||
:name="member.display_name"
|
||||
:color="member.color"
|
||||
:src="avatarUrl(member)"
|
||||
:offline="!online.has(member.id)"
|
||||
size="sm"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
</button>
|
||||
<button
|
||||
v-if="extra.length > 0"
|
||||
type="button"
|
||||
class="more-people"
|
||||
:title="extraTitle"
|
||||
:aria-label="`Show all ${members.length} people`"
|
||||
@click="emit('people')"
|
||||
>
|
||||
+{{ extra.length }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="icon-btn"
|
||||
aria-label="Invite people"
|
||||
title="Invite people"
|
||||
@click="emit('invite')"
|
||||
aria-label="People"
|
||||
title="People"
|
||||
@click="emit('people')"
|
||||
>
|
||||
<UserPlus :size="16" aria-hidden="true" />
|
||||
<Users :size="16" aria-hidden="true" />
|
||||
</button>
|
||||
|
||||
<button
|
||||
|
||||
Reference in new issue
Block a user