Add name and avatar to room info

This commit is contained in:
N-Pex 2021-01-20 16:39:28 +01:00
parent 19e8b64e7b
commit 92d7920072
2 changed files with 74 additions and 13 deletions

View file

@ -444,6 +444,33 @@ $admin-fg: white;
background-color: transparent; background-color: transparent;
border: none; border: none;
} }
.room-avatar {
background-color: #ededed;
width: 100px !important;
height: 100px !important;
margin-top: 20px;
margin-bottom: 20px;
.headline {
font-size: 80 * $chat-text-size !important;
}
}
.room-title {
margin-bottom: 20px;
padding-bottom: 20px;
font-family: "Poppins", sans-serif;
font-style: normal;
font-weight: 800;
font-size: 40 * $chat-text-size;
line-height: 108.5%;
/* or 43px */
text-align: center;
letter-spacing: -0.8px;
color: #000000;
overflow-wrap: break-word;
}
.room-name { .room-name {
text-align: center; text-align: center;
margin-top: 15px; margin-top: 15px;

View file

@ -2,8 +2,8 @@
<div v-if="room" class="room-info"> <div v-if="room" class="room-info">
<div class="chat-header"> <div class="chat-header">
<v-container fluid> <v-container fluid>
<div class="room-name" v-if="room"> <div class="room-name">
{{ room.summary.info.title }} Info
</div> </div>
<v-btn <v-btn
text text
@ -17,6 +17,18 @@
</v-container> </v-container>
</div> </div>
<v-card class="members ma-3" flat>
<div class="text-center">
<v-avatar class="room-avatar">
<v-img v-if="roomAvatar" :src="roomAvatar" />
<span v-else class="white--text headline">{{
roomName.substring(0, 1).toUpperCase()
}}</span>
</v-avatar>
</div>
<div class="room-title">{{ roomName }}</div>
</v-card>
<v-card class="members ma-3" flat> <v-card class="members ma-3" flat>
<v-card-title <v-card-title
>Members<v-spacer></v-spacer> >Members<v-spacer></v-spacer>
@ -61,27 +73,35 @@
<v-card class="account ma-3" flat> <v-card class="account ma-3" flat>
<v-card-text> <v-card-text>
<v-btn color="red" block class="filled-button" @click.stop="showLeaveConfirmation = true" <v-btn
>Leave group</v-btn color="red"
> block
<div> class="filled-button"
Note: This step cannot be undone. Make sure you want to logout and delete the chat forever. @click.stop="showLeaveConfirmation = true"
</div> >Leave group</v-btn
>
<div>
Note: This step cannot be undone. Make sure you want to logout and
delete the chat forever.
</div>
</v-card-text> </v-card-text>
</v-card> </v-card>
<LeaveRoomDialog :show="showLeaveConfirmation" :room="room" @close="showLeaveConfirmation = false" /> <LeaveRoomDialog
:show="showLeaveConfirmation"
:room="room"
@close="showLeaveConfirmation = false"
/>
</div> </div>
</template> </template>
<script> <script>
import LeaveRoomDialog from '../components/LeaveRoomDialog'; import LeaveRoomDialog from "../components/LeaveRoomDialog";
export default { export default {
name: "RoomInfo", name: "RoomInfo",
components: { components: {
LeaveRoomDialog LeaveRoomDialog,
}, },
data() { data() {
return { return {
@ -89,7 +109,7 @@ export default {
user: null, user: null,
displayName: "", displayName: "",
showAllMembers: false, showAllMembers: false,
showLeaveConfirmation: false showLeaveConfirmation: false,
}; };
}, },
mounted() { mounted() {
@ -108,6 +128,20 @@ export default {
return this.$matrix.currentRoom; return this.$matrix.currentRoom;
}, },
roomName() {
if (this.room) {
return this.room.name;
}
return "";
},
roomAvatar() {
if (this.room) {
return this.room.avatar;
}
return "";
},
joinedMembers() { joinedMembers() {
if (!this.room) { if (!this.room) {
return []; return [];