diff options
author | Corey Hulen <corey@hulen.com> | 2016-02-01 13:37:54 -0800 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2016-02-01 13:37:54 -0800 |
commit | f28486c4553f7f4bccf7bf69153c2f12699705f9 (patch) | |
tree | a75d26e483eb7feda3ee9282c09ff5dbe148f1db /web/react/components/rhs_comment.jsx | |
parent | a772b06e87d28fd75f15c9ec58c46c2439c8e281 (diff) | |
parent | e7f409a3c7a92d50cf857b808b61f4d5aadea8c3 (diff) | |
download | chat-f28486c4553f7f4bccf7bf69153c2f12699705f9.tar.gz chat-f28486c4553f7f4bccf7bf69153c2f12699705f9.tar.bz2 chat-f28486c4553f7f4bccf7bf69153c2f12699705f9.zip |
Merge pull request #2042 from ZBoxApp/PLT-7-sidebar-right
PLT-7: Refactoring frontend (chunk 9)
Diffstat (limited to 'web/react/components/rhs_comment.jsx')
-rw-r--r-- | web/react/components/rhs_comment.jsx | 41 |
1 files changed, 35 insertions, 6 deletions
diff --git a/web/react/components/rhs_comment.jsx b/web/react/components/rhs_comment.jsx index 7aae5177e..1addebbe4 100644 --- a/web/react/components/rhs_comment.jsx +++ b/web/react/components/rhs_comment.jsx @@ -16,7 +16,16 @@ import * as TextFormatting from '../utils/text_formatting.jsx'; import twemoji from 'twemoji'; import * as EventHelpers from '../dispatcher/event_helpers.jsx'; -export default class RhsComment extends React.Component { +import {intlShape, injectIntl, defineMessages, FormattedMessage, FormattedDate} from 'mm-intl'; + +const holders = defineMessages({ + comment: { + id: 'rhs_comment.comment', + defaultMessage: 'Comment' + } +}); + +class RhsComment extends React.Component { constructor(props) { super(props); @@ -95,12 +104,15 @@ export default class RhsComment extends React.Component { data-toggle='modal' data-target='#edit_post' data-refocusid='#reply_textbox' - data-title='Comment' + data-title={this.props.intl.formatMessage(holders.comment)} data-message={post.message} data-postid={post.id} data-channelid={post.channel_id} > - {'Edit'} + <FormattedMessage + id='rhs_comment.edit' + defaultMessage='Edit' + /> </a> </li> ); @@ -117,7 +129,10 @@ export default class RhsComment extends React.Component { role='menuitem' onClick={() => EventHelpers.showDeletePostModal(post, 0)} > - {'Delete'} + <FormattedMessage + id='rhs_comment.del' + defaultMessage='Delete' + /> </a> </li> ); @@ -165,7 +180,10 @@ export default class RhsComment extends React.Component { href='#' onClick={this.retryComment} > - {'Retry'} + <FormattedMessage + id='rhs_comment.retry' + defaultMessage='Retry' + /> </a> ); } else if (post.state === Constants.POST_LOADING) { @@ -208,7 +226,15 @@ export default class RhsComment extends React.Component { </li> <li className='col'> <time className='post__time'> - {Utils.displayCommentDateTime(post.create_at)} + <FormattedDate + value={post.create_at} + day='numeric' + month='long' + year='numeric' + hour12={true} + hour='2-digit' + minute='2-digit' + /> </time> </li> <li className='col col__reply'> @@ -237,5 +263,8 @@ RhsComment.defaultProps = { post: null }; RhsComment.propTypes = { + intl: intlShape.isRequired, post: React.PropTypes.object }; + +export default injectIntl(RhsComment);
\ No newline at end of file |