@@ -41,9 +41,15 @@ import {getUsername, getMessageText, createMessage} from './utils.js';
41
41
const ChatMessage = ( { self, from, body, date} ) => h ( 'div' , {
42
42
class : [ 'chat-message' , self ? 'chat-message-self' : 'chat-message-other' ] . join ( ' ' )
43
43
} , [
44
- h ( 'div' , { class : 'chat-message-date' } , date ) ,
45
- h ( 'div' , { class : 'chat-message-from' } , getUsername ( from ) ) ,
46
- h ( 'div' , { class : 'chat-message-body' } , body )
44
+ h ( 'div' , {
45
+ class : 'chat-message__header'
46
+ } , [
47
+ h ( 'div' , { class : 'chat-message__header--date' } , `${ date } - ` ) ,
48
+ h ( 'div' , { class : 'chat-message__header--username' } , `${ getUsername ( from ) } :` )
49
+ ] ) ,
50
+ h ( 'div' , {
51
+ class : 'chat-message__body'
52
+ } , body )
47
53
] ) ;
48
54
49
55
export const createChatWindow = ( core , proc , parent , bus , options ) => {
@@ -60,7 +66,7 @@ export const createChatWindow = (core, proc, parent, bus, options) => {
60
66
61
67
const messages = ( state , actions ) => state . messages . map ( ( { date, msg} ) => {
62
68
return h ( ChatMessage , {
63
- date : format ( date , 'fullDate ' ) ,
69
+ date : format ( date , 'longTime ' ) ,
64
70
self : getUsername ( msg . getAttribute ( 'from' ) ) !== getUsername ( options . user ) ,
65
71
to : msg . getAttribute ( 'to' ) ,
66
72
from : msg . getAttribute ( 'from' ) ,
0 commit comments