Skip to content

Commit 5e71d35

Browse files
Added 'box-sizing: border-box' to title image. Added chatListImageUrl param.
1 parent cf612b3 commit 5e71d35

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
@@ -4,7 +4,7 @@
44
v-if="showHeader"
55
:show-chat-list-button="multipleChatsEnabled && !showingChatList"
66
:title="showingChatList ? chatListTitle : title"
7-
:image-url="titleImageUrl"
7+
:image-url="showingChatList ? chatListImageUrl : titleImageUrl"
88
@close="$emit('close')"
99
:colors="colors"
1010
:disable-user-list-toggle="disableUserListToggle || showingChatList"
@@ -20,7 +20,7 @@
2020
v-if="showingChatList"
2121
:colors="colors"
2222
:chatList="chatList"
23-
@changeCurrentChat="(chatID) => { this.$emit('changeCurrentChat', chatID) }"
23+
@changeCurrentChat="(chatID) => { $emit('changeCurrentChat', chatID) }"
2424
@showMessageList="handleShowMessageList"
2525
/>
2626
<MessageList
@@ -130,6 +130,10 @@ export default {
130130
type: String,
131131
required: true
132132
},
133+
chatListImageUrl: {
134+
type: String,
135+
default: ''
136+
},
133137
onUserInputSubmit: {
134138
type: Function,
135139
required: true

src/Header.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ export default {
7878
border-radius: 50%;
7979
align-self: center;
8080
padding: 10px;
81-
width:34px;
82-
height:34px;
81+
box-sizing: border-box;
82+
width:54px;
83+
height:54px;
8384
}
8485
8586
.sc-header--title {

src/Launcher.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
:multiple-chats-enabled="multipleChatsEnabled"
3737
:chat-list="chatList"
3838
:chat-list-title="chatListTitle"
39+
:chat-list-image-url="chatListImageUrl"
3940
:myId="myId"
4041
@scrollToTop="$emit('scrollToTop')"
4142
@onType="$emit('onType')"
@@ -248,6 +249,10 @@ export default {
248249
type: String,
249250
default: () => ''
250251
},
252+
chatListImageUrl: {
253+
type: String,
254+
default: () => ''
255+
},
251256
myId: {
252257
type: String,
253258
default: 'me'

0 commit comments

Comments
 (0)