File tree Expand file tree Collapse file tree 2 files changed +46
-8
lines changed Expand file tree Collapse file tree 2 files changed +46
-8
lines changed Original file line number Diff line number Diff line change 59
59
line-height : 1.4 ;
60
60
}
61
61
62
+ $avatar-size : 28px ;
63
+
62
64
.vac-avatar {
63
- height : 28 px ;
64
- width : 28 px ;
65
- min-height : 28 px ;
66
- min-width : 28 px ;
65
+ height : $avatar-size ;
66
+ width : $avatar-size ;
67
+ min-height : $avatar-size ;
68
+ min-width : $avatar-size ;
67
69
margin : 0 0 2px 0 ;
68
70
align-self : flex-end ;
69
71
}
70
72
73
+ .vac-avatar-current-offset {
74
+ margin-right : $avatar-size ;
75
+ }
76
+
77
+ .vac-avatar-offset {
78
+ margin-left : $avatar-size ;
79
+ }
80
+
71
81
.vac-failure-container {
72
82
position : relative ;
73
83
align-self : flex-end ;
225
235
max-width : 80% ;
226
236
}
227
237
238
+ $avatar-size-small : 25px ;
239
+
228
240
.vac-avatar {
229
- height : 25 px ;
230
- width : 25 px ;
231
- min-height : 25 px ;
232
- min-width : 25 px ;
241
+ height : $avatar-size-small ;
242
+ width : $avatar-size-small ;
243
+ min-height : $avatar-size-small ;
244
+ min-width : $avatar-size-small ;
233
245
margin : 0 6px 1px 0 ;
234
246
235
247
& .vac-avatar-current {
236
248
margin : 0 0 1px 6px ;
237
249
}
238
250
}
239
251
252
+ .vac-avatar-current-offset {
253
+ margin-right : calc (#{$avatar-size-small } + 6px );
254
+ }
255
+
256
+ .vac-avatar-offset {
257
+ margin-left : calc (#{$avatar-size-small } + 6px );
258
+ }
259
+
240
260
.vac-failure-container {
241
261
margin-left : 2px ;
242
262
Original file line number Diff line number Diff line change 33
33
class =" vac-avatar"
34
34
:style =" { 'background-image': `url('${message.avatar}')` }"
35
35
/>
36
+ <div
37
+ v-if =" hasSenderUserAvatar && !message.avatar"
38
+ class =" vac-avatar-offset"
39
+ />
36
40
<div
37
41
class =" vac-message-container"
38
42
:class =" {
194
198
class =" vac-avatar vac-avatar-current"
195
199
:style =" { 'background-image': `url('${message.avatar}')` }"
196
200
/>
201
+ <div
202
+ v-if =" hasCurrentUserAvatar && !message.avatar"
203
+ class =" vac-avatar-current-offset"
204
+ />
197
205
</slot >
198
206
</div >
199
207
</div >
@@ -292,6 +300,16 @@ export default {
292
300
! this .message .deleted &&
293
301
(this .message .saved || this .message .distributed || this .message .seen )
294
302
)
303
+ },
304
+ hasCurrentUserAvatar () {
305
+ return this .messages .some (
306
+ message => message .senderId === this .currentUserId && message .avatar
307
+ )
308
+ },
309
+ hasSenderUserAvatar () {
310
+ return this .messages .some (
311
+ message => message .senderId !== this .currentUserId && message .avatar
312
+ )
295
313
}
296
314
},
297
315
You can’t perform that action at this time.
0 commit comments