twister-react/js/Postboard.js
2015-04-29 11:02:32 +02:00

34 lines
933 B
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("./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})
);
});
return (
React.createElement(ListGroup, {fill: true},
this.props.header,
React.createElement(ReactCSSTransitionGroup, {transitionName: "item"},
posts
)
)
);
}
});