twister-react/js/Postboard.js

34 lines
933 B
JavaScript
Raw Normal View History

2015-04-21 19:38:17 +02:00
var ReactBootstrap = require('react-bootstrap')
, NavItem = ReactBootstrap.NavItem
, Nav = ReactBootstrap.Nav
, ListGroup = ReactBootstrap.ListGroup
2015-04-29 11:02:32 +02:00
, ListGroupItem = ReactBootstrap.ListGroupItem
2015-04-21 19:38:17 +02:00
, Panel = ReactBootstrap.Panel
2015-04-29 11:02:32 +02:00
, Glyphicon = ReactBootstrap.Glyphicon
, Button = ReactBootstrap.Button
2015-04-21 19:38:17 +02:00
2015-04-29 11:02:32 +02:00
var React = require('react/addons');
var ReactCSSTransitionGroup = React.addons.CSSTransitionGroup;
2015-04-21 19:38:17 +02:00
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})
);
});
2015-04-29 11:02:32 +02:00
2015-04-21 19:38:17 +02:00
return (
React.createElement(ListGroup, {fill: true},
2015-04-29 11:02:32 +02:00
this.props.header,
React.createElement(ReactCSSTransitionGroup, {transitionName: "item"},
posts
)
2015-04-21 19:38:17 +02:00
)
);
}
});