From 7d3124c934ad18ec6ceb42929a7add8d07980d0f Mon Sep 17 00:00:00 2001 From: N-Pex Date: Wed, 9 Dec 2020 15:20:50 +0100 Subject: [PATCH] More work on chat header --- src/assets/css/chat.scss | 27 +++++++++------------------ src/assets/css/main.scss | 2 ++ src/components/Chat.vue | 22 +++++++++++----------- src/components/ChatHeader.vue | 34 ++++++++++++++++++++++++++-------- 4 files changed, 48 insertions(+), 37 deletions(-) diff --git a/src/assets/css/chat.scss b/src/assets/css/chat.scss index 0bd00c3..8fc8fde 100644 --- a/src/assets/css/chat.scss +++ b/src/assets/css/chat.scss @@ -23,42 +23,33 @@ $chat-text-size: 0.7pt; .chat-header { margin: 0; padding: 0; - background-color: #e2e2e2; + background-color: #ffffff; + border-bottom: 1px solid #eeeeee; .chat-header-row { margin: 0; padding: 4px 10px; align-items: center; } - .members-icon { - margin-bottom: 0; - } - .chat-header-members { - position: relative; - } .num-members { - position: absolute; - bottom: -2px; - left: 0; - right: 0; font-family: 'Titillium Web', sans-serif; font-weight: 400; - font-size: 11 * $chat-text-size; + font-size: 12 * $chat-text-size; color: black; } .room-name { - font-family: 'Titillium Web', sans-serif; + font-family: 'Poppins', sans-serif; font-weight: 700; - font-size: 18 * $chat-text-size; + font-size: 21 * $chat-text-size; color: black; } .v-btn.leave-button { font-family: 'Titillium Web', sans-serif; - font-weight: 400; - font-size: 14 * $chat-text-size; + font-weight: 700; + font-size: 11 * $chat-text-size; color: white; - background-color: #cc0000 !important; + background-color: #f74e4e !important; border: none; - border-radius: 4px; + border-radius: $chat-standard-padding / 2; height: $chat-standard-padding; margin-top: $chat-standard-padding-xs; margin-bottom: $chat-standard-padding-xs; diff --git a/src/assets/css/main.scss b/src/assets/css/main.scss index abc0154..379a96c 100644 --- a/src/assets/css/main.scss +++ b/src/assets/css/main.scss @@ -1 +1,3 @@ $background: #008860; + +@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@700&display=swap'); \ No newline at end of file diff --git a/src/components/Chat.vue b/src/components/Chat.vue index e628413..662ca48 100644 --- a/src/components/Chat.vue +++ b/src/components/Chat.vue @@ -213,7 +213,6 @@ export default { data() { return { - room: null, events: [], currentInput: "", contactIsTyping: false, @@ -250,8 +249,14 @@ export default { }, computed: { + room() { + return this.$matrix.currentRoom; + }, roomId() { - return this.$matrix.currentRoomId; + if (!this.room) { + return null; + } + return this.room.roomId; }, sendButtonDisabled() { return this.currentInput.length == 0; @@ -259,24 +264,19 @@ export default { }, watch: { - roomId: { - handler(ignoredNewVal, ignoredOldVal) { + room: { + handler(room, ignoredOldVal) { console.log("Chat: Current room changed"); // Clear old events this.events = []; this.timelineWindow = null; this.contactIsTyping = false; - - if (!this.roomId) { + + if (!room) { return; // no room } - this.room = this.$matrix.getRoom(this.roomId); - if (!this.room) { - return; // Not found - } - this.timelineWindow = new TimelineWindow( this.$matrix.matrixClient, this.room.getUnfilteredTimelineSet(), diff --git a/src/components/ChatHeader.vue b/src/components/ChatHeader.vue index a9e0746..dfd6ce5 100644 --- a/src/components/ChatHeader.vue +++ b/src/components/ChatHeader.vue @@ -1,20 +1,20 @@