Skip to content

Commit be7159f

Browse files
Added 'box-sizing: border-box' to title image. Added chatListImageUrl param.
1 parent 2ee5991 commit be7159f

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

demo/src/App.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
:showConfirmationDeletion="true"
2626
:confirmationDeletionMessage="'Are you sure? (you can customize this message)'"
2727
:titleImageUrl="titleImageUrl"
28+
:chatListImageUrl="chatListImageUrl"
2829
:placeholder="placeholder"
2930
:multipleChatsEnabled="multipleChatsEnabled"
3031
:chatList="chatList"
@@ -135,8 +136,8 @@ export default {
135136
},
136137
data() {
137138
return {
138-
titleImageUrl:
139-
'https://a.slack-edge.com/66f9/img/avatars-teams/ava_0001-34.png',
139+
titleImageUrl: "https://a.slack-edge.com/66f9/img/avatars-teams/ava_0001-34.png",
140+
chatListImageUrl: "https://a.slack-edge.com/66f9/img/avatars-teams/ava_0001-34.png",
140141
chatHistory: chatHistory,
141142
isChatOpen: false,
142143
showTypingIndicator: '',
@@ -217,6 +218,9 @@ export default {
217218
handleChangeCurrentChat(newCurrentChatID) {
218219
this.showTypingIndicator = ''
219220
this.currentChatID = newCurrentChatID
221+
const chat = this.chatHistory[this.currentChatID]
222+
this.titleImageUrl = chat.imageUrl
223+
this.title = chat.name
220224
},
221225
handleMultipleChatsEnabledChange(newMultipleChatsEnabled) {
222226
this.multipleChatsEnabled = newMultipleChatsEnabled

src/ChatWindow.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
:show-close-button="showCloseButton"
66
:show-chat-list-button="multipleChatsEnabled && !showingChatList"
77
:title="showingChatList ? chatListTitle : title"
8-
:image-url="titleImageUrl"
8+
:image-url="showingChatList ? chatListImageUrl : titleImageUrl"
99
:on-close="onClose"
1010
:colors="colors"
1111
:disable-user-list-toggle="disableUserListToggle || showingChatList"
@@ -21,7 +21,7 @@
2121
v-if="showingChatList"
2222
:colors="colors"
2323
:chatList="chatList"
24-
@changeCurrentChat="(chatID) => { this.$emit('changeCurrentChat', chatID) }"
24+
@changeCurrentChat="(chatID) => { $emit('changeCurrentChat', chatID) }"
2525
@showMessageList="handleShowMessageList"
2626
/>
2727
<MessageList
@@ -139,6 +139,10 @@ export default {
139139
type: String,
140140
default: ''
141141
},
142+
chatListImageUrl: {
143+
type: String,
144+
default: ''
145+
},
142146
onUserInputSubmit: {
143147
type: Function,
144148
required: true

src/Header.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,9 @@ export default {
9090
border-radius: 50%;
9191
align-self: center;
9292
padding: 10px;
93-
width:34px;
94-
height:34px;
93+
box-sizing: border-box;
94+
width:54px;
95+
height:54px;
9596
}
9697
9798
.sc-header--title {

src/Launcher.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
:multiple-chats-enabled="multipleChatsEnabled"
4040
:chat-list="chatList"
4141
:chat-list-title="chatListTitle"
42+
:chat-list-image-url="chatListImageUrl"
4243
:myId="myId"
4344
@scrollToTop="$emit('scrollToTop')"
4445
@onType="$emit('onType')"
@@ -250,6 +251,10 @@ export default {
250251
type: String,
251252
default: () => ''
252253
},
254+
chatListImageUrl: {
255+
type: String,
256+
default: () => ''
257+
},
253258
myId: {
254259
type: String,
255260
default: 'me'

0 commit comments

Comments
 (0)