mirror of
https://github.com/twisterarmy/twister-react.git
synced 2025-01-27 15:14:30 +00:00
43 lines
1.2 KiB
JavaScript
43 lines
1.2 KiB
JavaScript
|
|
var ReactBootstrap = require('react-bootstrap')
|
|
, NavItem = ReactBootstrap.NavItem
|
|
, Nav = ReactBootstrap.Nav
|
|
, ListGroup = ReactBootstrap.ListGroup
|
|
, ListGroupItem = ReactBootstrap.ListGroupItem
|
|
, Panel = ReactBootstrap.Panel
|
|
, Glyphicon = ReactBootstrap.Glyphicon
|
|
, Button = ReactBootstrap.Button
|
|
|
|
var React = require('react/addons');
|
|
|
|
var ReactCSSTransitionGroup = React.addons.CSSTransitionGroup;
|
|
|
|
var Post = require("../common/Post.js");
|
|
|
|
module.exports = Postboard = React.createClass({displayName: "Postboard",
|
|
render: function() {
|
|
var posts = this.props.data.map(function(post, index) {
|
|
return (
|
|
React.createElement(Post, {post: post, key: post.postid})
|
|
);
|
|
});
|
|
|
|
if (this.props.loading) {
|
|
var spinner = (
|
|
React.createElement(ListGroupItem, null, React.createElement("p", {className: "text-center"}, React.createElement("img", {src: "img/bouncing_ball.gif"})))
|
|
);
|
|
} else {
|
|
var spinner = (React.createElement("span", null));
|
|
}
|
|
|
|
return (
|
|
React.createElement(ListGroup, {fill: true},
|
|
this.props.header,
|
|
spinner,
|
|
React.createElement(ReactCSSTransitionGroup, {transitionName: "item"},
|
|
posts
|
|
)
|
|
)
|
|
);
|
|
}
|
|
});
|