Skip to content

Commit 6f0ca1f

Browse files
committed
(feat) add seen icon in rooms list
1 parent ac169b9 commit 6f0ca1f

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

demo/src/ChatContainer.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ export default {
273273
if (message.file) content = `${message.file.name}.${message.file.type}`
274274
if (message.deleted) content = 'This message was deleted'
275275
276-
return { content, timestamp }
276+
return { content, timestamp, seen: message.seen }
277277
},
278278
279279
fetchMessages({ room, options = {} }) {

src/ChatWindow/ChatMessage.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,6 @@ export default {
372372
height: 14px;
373373
width: 14px;
374374
vertical-align: middle;
375-
margin: -3px 0px 0 3px;
375+
margin: -3px 0 0 3px;
376376
}
377377
</style>

src/ChatWindow/RoomsList.vue

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@
4040
<div class="name-container">
4141
<div class="room-name">{{ room.roomName }}</div>
4242
<div class="room-name text-last" v-if="room.lastMessage">
43-
{{ room.lastMessage.content }}
43+
<span v-if="room.lastMessage.seen">
44+
<svg-icon fill="#0696c7" name="check" class="icon-check" />
45+
</span>
46+
<span>{{ room.lastMessage.content }}</span>
4447
</div>
4548
<div class="room-name text-date" v-if="room.lastMessage">
4649
{{ room.lastMessage.timestamp }}
@@ -185,7 +188,7 @@ export default {
185188
flex: 1 1 100%;
186189
padding: 0 16px;
187190
position: relative;
188-
min-height: 70px;
191+
min-height: 71px;
189192
}
190193
191194
.room-avatar {
@@ -217,22 +220,30 @@ export default {
217220
overflow: hidden;
218221
text-overflow: ellipsis;
219222
white-space: nowrap;
220-
line-height: 20px;
223+
line-height: 22px;
221224
}
222225
223226
.text-last {
224227
color: #67717a !important;
225228
font-size: 12px;
226-
line-height: 15px;
229+
line-height: 16px;
227230
}
228231
229232
.text-date {
230233
color: #a2aeb8 !important;
231234
font-size: 11px;
232-
line-height: 15px;
235+
line-height: 16px;
233236
}
234237
235238
.room-disabled {
236239
pointer-events: none;
237240
}
241+
242+
.icon-check {
243+
height: 14px;
244+
width: 14px;
245+
vertical-align: middle;
246+
margin-top: -1px;
247+
margin-right: 1px;
248+
}
238249
</style>

0 commit comments

Comments
 (0)