Comment.jsx 1.0KB

1234567891011121314151617181920212223242526272829
  1. import React from 'react'
  2. import classnames from 'classnames'
  3. const Comment = props => (
  4. <li className={classnames(
  5. `${props.customClass}__messagelist__item`,
  6. 'timeline__messagelist__item', {
  7. 'received': props.fromMe, // @FIXME : invert names of class (received should be !fromMe)
  8. 'sended': !props.fromMe
  9. }
  10. )}>
  11. <div className={classnames(`${props.customClass}__messagelist__item__wrapper`, 'timeline__messagelist__item__wrapper')}>
  12. <div className={classnames(`${props.customClass}__messagelist__item__avatar`, 'timeline__messagelist__item__avatar')}>
  13. {props.avatar ? <img src={props.avatar} /> : ''}
  14. </div>
  15. </div>
  16. <div
  17. className={classnames(`${props.customClass}__messagelist__item__createhour`, 'timeline__messagelist__item__createhour')}>
  18. {props.createdAt}
  19. </div>
  20. <div
  21. className={classnames(`${props.customClass}__messagelist__item__content`, 'timeline__messagelist__item__content')}
  22. dangerouslySetInnerHTML={{__html: props.text}}
  23. />
  24. </li>
  25. )
  26. export default Comment