Skip to content

Commit 344875f

Browse files
committed
Merge pull request shakacode#164 from mamute/enable-react-animations
enable react animations for comments list
2 parents 01a14b2 + fe1c4d4 commit 344875f

File tree

4 files changed

+102
-78
lines changed

4 files changed

+102
-78
lines changed

client/app/components/CommentList.jsx

+13-6
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ class CommentList extends React.Component {
3333

3434
render() {
3535
const { $$comments } = this.props;
36-
const commentNodes = $$comments.reverse().map(($$comment, index) => {
36+
const commentNodes = $$comments.reverse().map($$comment => {
3737
// `key` is a React-specific concept and is not mandatory for the
3838
// purpose of this tutorial. if you're curious, see more here:
3939
// http://facebook.github.io/react/docs/multiple-components.html#dynamic-children
4040
return (
4141
<Comment
42-
key={index}
42+
key={$$comment.get('id')}
4343
author={$$comment.get('author')}
4444
text={$$comment.get('text')}
4545
/>
@@ -50,14 +50,21 @@ class CommentList extends React.Component {
5050
<div>
5151
<ReactCSSTransitionGroup
5252
transitionName="element"
53-
transitionEnterTimeout={300}
54-
transitionLeaveTimeout={300}
53+
transitionEnterTimeout={500}
54+
transitionLeaveTimeout={500}
5555
>
5656
{this._errorWarning()}
5757
</ReactCSSTransitionGroup>
58-
<div className="commentList">
58+
59+
<ReactCSSTransitionGroup
60+
transitionName="element"
61+
transitionEnterTimeout={500}
62+
transitionLeaveTimeout={500}
63+
className="commentList"
64+
component="div"
65+
>
5966
{commentNodes}
60-
</div>
67+
</ReactCSSTransitionGroup>
6168
</div>
6269
);
6370
}

0 commit comments

Comments
 (0)