2020-11-09 10:26:56 +01:00
|
|
|
<template>
|
2021-02-01 22:10:48 +01:00
|
|
|
<v-list dense class="room-list">
|
2020-11-09 10:26:56 +01:00
|
|
|
<v-subheader>ROOMS</v-subheader>
|
2020-11-09 15:08:36 +01:00
|
|
|
<v-list-item-group v-model="currentRoomId" color="primary">
|
|
|
|
|
<v-list-item v-for="room in $matrix.rooms" :key="room.roomId" :value="room.roomId">
|
2021-02-17 10:43:42 +01:00
|
|
|
<v-list-item-avatar size="40" color="#e0e0e0">
|
2020-11-11 17:35:14 +01:00
|
|
|
<v-img :src="room.avatar" />
|
|
|
|
|
</v-list-item-avatar>
|
2021-02-17 10:43:42 +01:00
|
|
|
<div class="room-list-notification-count">{{ notificationCount(room) }}</div>
|
2020-11-09 10:26:56 +01:00
|
|
|
<v-list-item-content>
|
2020-11-09 15:55:17 +01:00
|
|
|
<v-list-item-title>{{ room.summary.info.title }}</v-list-item-title>
|
|
|
|
|
<v-list-item-subtitle>{{ room.topic }}</v-list-item-subtitle>
|
2020-11-09 10:26:56 +01:00
|
|
|
</v-list-item-content>
|
|
|
|
|
</v-list-item>
|
|
|
|
|
</v-list-item-group>
|
|
|
|
|
</v-list>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2021-02-01 16:04:12 +01:00
|
|
|
import util from "../plugins/utils";
|
|
|
|
|
|
2020-11-09 10:26:56 +01:00
|
|
|
export default {
|
|
|
|
|
name: "RoomList",
|
|
|
|
|
|
|
|
|
|
data: () => ({
|
2021-02-17 10:43:42 +01:00
|
|
|
currentRoomId: null,
|
2020-11-09 10:26:56 +01:00
|
|
|
}),
|
|
|
|
|
|
2021-02-17 10:43:42 +01:00
|
|
|
methods: {
|
|
|
|
|
notificationCount(room) {
|
|
|
|
|
return room.getUnreadNotificationCount('total') || 0;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
2020-11-09 10:26:56 +01:00
|
|
|
watch: {
|
2020-11-09 15:08:36 +01:00
|
|
|
currentRoomId() {
|
2020-11-19 17:11:11 +01:00
|
|
|
this.$emit("close");
|
2021-02-01 16:04:12 +01:00
|
|
|
this.$navigation.push({name: 'Chat', params: { roomId: util.sanitizeRoomId(this.currentRoomId) }}, -1);
|
2020-11-09 10:26:56 +01:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
2021-02-17 10:43:42 +01:00
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
|
@import "@/assets/css/chat.scss";
|
|
|
|
|
</style>
|