-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathmessage-detail.coffee
More file actions
28 lines (28 loc) · 1.04 KB
/
message-detail.coffee
File metadata and controls
28 lines (28 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
'use strict'
hsl = require('hsl')
React = require('react')
Immutable = require('immutable')
Hint = React.createFactory(require('./hint'))
Space = React.createFactory(require('./space'))
Author = React.createFactory(require('./author'))
TopicEntry = React.createFactory(require('./topic-entry'))
ReplyDetail = React.createFactory(require('./reply-detail'))
div = React.DOM.div
module.exports = React.createClass(
displayName: 'message-detail'
propTypes: message: React.PropTypes.instanceOf(Immutable.Map).isRequired
render: ->
author = @props.message.get('author')
topic = @props.message.get('topic').set('author', author)
reply = @props.message.get('reply').set('author', author)
div { style: @styleRoot() }, div({ style: @styleInfo() }, Author(
author: @props.message.get('author')
showName: true), Space(width: 10), Hint(text: @props.message.get('type'))), TopicEntry(topic: topic), ReplyDetail(reply: reply)
styleRoot: ->
{ padding: '0 10px' }
styleInfo: ->
{
display: 'flex'
alignItems: 'center'
}
)