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 5959 line-height : 1.4 ;
6060 }
6161
62+ $avatar-size : 28px ;
63+
6264 .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 ;
6769 margin : 0 0 2px 0 ;
6870 align-self : flex-end ;
6971 }
7072
73+ .vac-avatar-current-offset {
74+ margin-right : $avatar-size ;
75+ }
76+
77+ .vac-avatar-offset {
78+ margin-left : $avatar-size ;
79+ }
80+
7181 .vac-failure-container {
7282 position : relative ;
7383 align-self : flex-end ;
225235 max-width : 80% ;
226236 }
227237
238+ $avatar-size-small : 25px ;
239+
228240 .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 ;
233245 margin : 0 6px 1px 0 ;
234246
235247 & .vac-avatar-current {
236248 margin : 0 0 1px 6px ;
237249 }
238250 }
239251
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+
240260 .vac-failure-container {
241261 margin-left : 2px ;
242262
Original file line number Diff line number Diff line change 3333 class =" vac-avatar"
3434 :style =" { 'background-image': `url('${message.avatar}')` }"
3535 />
36+ <div
37+ v-if =" hasSenderUserAvatar && !message.avatar"
38+ class =" vac-avatar-offset"
39+ />
3640 <div
3741 class =" vac-message-container"
3842 :class =" {
194198 class =" vac-avatar vac-avatar-current"
195199 :style =" { 'background-image': `url('${message.avatar}')` }"
196200 />
201+ <div
202+ v-if =" hasCurrentUserAvatar && !message.avatar"
203+ class =" vac-avatar-current-offset"
204+ />
197205 </slot >
198206 </div >
199207 </div >
@@ -292,6 +300,16 @@ export default {
292300 ! this .message .deleted &&
293301 (this .message .saved || this .message .distributed || this .message .seen )
294302 )
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+ )
295313 }
296314 },
297315
You can’t perform that action at this time.
0 commit comments