瀏覽代碼

fix issue https://github.com/tracim/tracim/issues/630

AlexiCauvin 5 年之前
父節點
當前提交
66d4b29b77

+ 11 - 4
frontend_lib/src/component/Timeline/Comment.jsx 查看文件

26
         </div>
26
         </div>
27
       </div>
27
       </div>
28
       <div
28
       <div
29
-        className={classnames(`${props.customClass}__messagelist__item__createhour`, 'timeline__body__messagelist__item__createhour')}>
30
-        {props.createdAt}
29
+        className={classnames(`${props.customClass}__messagelist__item__authorandhour`, 'timeline__body__messagelist__item__authorandhour')}>
30
+          <div className='mr-5'>
31
+            {props.createdAt}
32
+          </div>
33
+          {props.author}
31
       </div>
34
       </div>
32
       <div
35
       <div
33
         className={classnames(`${props.customClass}__messagelist__item__content`, 'timeline__body__messagelist__item__content')}
36
         className={classnames(`${props.customClass}__messagelist__item__content`, 'timeline__body__messagelist__item__content')}
34
         style={props.fromMe ? styleSent : styleReceived}
37
         style={props.fromMe ? styleSent : styleReceived}
35
-        dangerouslySetInnerHTML={{__html: props.text}}
36
-      />
38
+
39
+      >
40
+        <div className='timeline__body__messagelist__item__content__text'>
41
+          {props.text}
42
+        </div>
43
+      </div>
37
     </li>
44
     </li>
38
   )
45
   )
39
 }
46
 }

+ 1 - 0
frontend_lib/src/component/Timeline/Timeline.jsx 查看文件

54
                   return <Comment
54
                   return <Comment
55
                     customClass={props.customClass}
55
                     customClass={props.customClass}
56
                     customColor={props.customColor}
56
                     customColor={props.customColor}
57
+                    author={content.author.public_name}
57
                     avatar={content.author.avatar_url}
58
                     avatar={content.author.avatar_url}
58
                     createdAt={content.created}
59
                     createdAt={content.created}
59
                     text={content.raw_content}
60
                     text={content.raw_content}

+ 5 - 2
frontend_lib/src/component/Timeline/Timeline.styl 查看文件

45
             width 45px
45
             width 45px
46
             height 45px
46
             height 45px
47
             border-radius 25px
47
             border-radius 25px
48
-        &__createhour
49
-          margin-left 35px
48
+        &__authorandhour
49
+          display flex
50
+          align-items center
51
+          justify-content flex-end
52
+          margin-right 35px
50
           opacity 0.7
53
           opacity 0.7
51
           font-size 14px
54
           font-size 14px
52
         &__content
55
         &__content