-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(chat): new group member sidebar for group chats (#4747)
* feat(sidebar): show group members in group chat * feat(chat): wip added typing status * fix: remove dummy text
- Loading branch information
Showing
7 changed files
with
110 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<template> | ||
<div class="user-list hover-scroll"> | ||
<TypographyText> | ||
{{ $t('pages.chat.members', { count: userDetails.length }) }} | ||
</TypographyText> | ||
<div v-for="user in userDetails" :key="user.did" class="user"> | ||
<UiUserState :user="user" :conversation-id="conversationId" /> | ||
<TypographyText class="ellipsis"> | ||
{{ user.name }} | ||
</TypographyText> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import Vue, { computed, ComputedRef, reactive } from 'vue' | ||
import iridium from '~/libraries/Iridium/IridiumManager' | ||
import { conversationHooks } from '~/components/compositions/conversations' | ||
import { User } from '~/libraries/Iridium/users/types' | ||
export default Vue.extend({ | ||
setup() { | ||
const { conversation, conversationId } = conversationHooks() | ||
const state = reactive({ | ||
users: iridium.users, | ||
}) | ||
const userDetails: ComputedRef<User[]> = computed(() => { | ||
if (!conversation.value) { | ||
return [] | ||
} | ||
const arr = conversation.value.participants.map((p) => | ||
state.users.getUser(p), | ||
) as User[] | ||
return arr.sort((a, b) => a.name.localeCompare(b.name)) | ||
}) | ||
return { conversation, conversationId, userDetails } | ||
}, | ||
}) | ||
</script> | ||
|
||
<style lang="less" scoped> | ||
.user-list { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 16px; | ||
padding: 16px; | ||
width: 240px; | ||
overflow-y: auto; | ||
background: @foreground-gradient; | ||
box-shadow: @ui-shadow; | ||
user-select: none; | ||
.user { | ||
display: flex; | ||
gap: 8px; | ||
align-items: center; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,49 @@ | ||
<template src="./Chat.html"></template> | ||
|
||
<script lang="ts"> | ||
import Vue from 'vue' | ||
import Vue, { computed, ComputedRef, reactive } from 'vue' | ||
import iridium from '~/libraries/Iridium/IridiumManager' | ||
import { conversationHooks } from '~/components/compositions/conversations' | ||
export default Vue.extend({ | ||
name: 'Chat', | ||
layout: 'desktop', | ||
data() { | ||
return { | ||
webrtc: iridium.webRTC.state, | ||
} | ||
}, | ||
computed: { | ||
isActiveCall(): boolean { | ||
return iridium.webRTC.isActiveCall(this.$route.params.id) | ||
}, | ||
setup() { | ||
const { conversationId, conversation, isGroup } = conversationHooks() | ||
const state = reactive({ | ||
webrtc: iridium.webRTC, | ||
}) | ||
const isActiveCall: ComputedRef<boolean> = computed(() => { | ||
return state.webrtc.isActiveCall(conversationId.value) | ||
}) | ||
return { conversation, isGroup, isActiveCall } | ||
}, | ||
}) | ||
</script> | ||
|
||
<style lang="less" src="./Chat.less" scoped></style> | ||
<style lang="less" scoped> | ||
.chat { | ||
display: flex; | ||
flex-direction: column; | ||
flex-grow: 1; | ||
justify-content: flex-end; | ||
padding: 16px 0 16px 16px; | ||
min-width: 0; | ||
.outer-wrapper { | ||
display: flex; | ||
overflow: hidden; | ||
flex-grow: 1; | ||
gap: 8px; | ||
.inner-wrapper { | ||
display: flex; | ||
flex-direction: column; | ||
flex-grow: 1; | ||
} | ||
} | ||
} | ||
</style> |