diff options
Diffstat (limited to 'web/react/components/post_body.jsx')
-rw-r--r-- | web/react/components/post_body.jsx | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/web/react/components/post_body.jsx b/web/react/components/post_body.jsx index 860c96d84..65e045344 100644 --- a/web/react/components/post_body.jsx +++ b/web/react/components/post_body.jsx @@ -59,23 +59,35 @@ module.exports = React.createClass({ postClass += " post-comment"; } + var loading; + if (post.did_fail) { + postClass += " post-fail"; + loading = <a className="post-retry pull-right" href="#" onClick={this.props.retryPost}>Retry</a>; + } else if (post.is_loading) { + postClass += " post-waiting"; + loading = <img className="post-loading-gif pull-right" src="/static/images/load.gif"/>; + } + var embed; if (filenames.length === 0 && this.state.links) { embed = utils.getEmbed(this.state.links[0]); } + var fileAttachmentHolder = ''; + if (filenames && filenames.length > 0) { + fileAttachmentHolder = (<FileAttachmentList + filenames={filenames} + modalId={'view_image_modal_' + post.id} + channelId={post.channel_id} + userId={post.user_id} />); + } + return ( <div className="post-body"> - { comment } - <p key={post.id+"_message"} className={postClass}><span>{inner}</span></p> - { filenames && filenames.length > 0 ? - <FileAttachmentList - filenames={filenames} - modalId={"view_image_modal_" + post.id} - channelId={post.channel_id} - userId={post.user_id} /> - : "" } - { embed } + {comment} + <p key={post.id+"_message"} className={postClass}>{loading}<span>{inner}</span></p> + {fileAttachmentHolder} + {embed} </div> ); } |