Skip to content

Commit 1cb16f5

Browse files
committed
fix warning on SimpleCommentScreen: required propType cssTransitionGroupClassNames
1 parent e78dbda commit 1cb16f5

File tree

4 files changed

+172
-326
lines changed

4 files changed

+172
-326
lines changed

client/app/bundles/comments/components/SimpleCommentScreen/SimpleCommentScreen.jsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import PureRenderMixin from 'react-addons-pure-render-mixin';
77
import metaTagsManager from 'libs/metaTagsManager';
88
import CommentForm from '../CommentBox/CommentForm/CommentForm';
99
import CommentList from '../CommentBox/CommentList/CommentList';
10+
import css from './SimpleCommentScreen.scss';
1011

1112
export default class SimpleCommentScreen extends React.Component {
1213
constructor(props, context) {
@@ -70,6 +71,13 @@ export default class SimpleCommentScreen extends React.Component {
7071
}
7172

7273
render() {
74+
const cssTransitionGroupClassNames = {
75+
enter: css.elementEnter,
76+
enterActive: css.elementEnterActive,
77+
leave: css.elementLeave,
78+
leaveActive: css.elementLeaveActive,
79+
};
80+
7381
return (
7482
<div className="commentBox container">
7583
<h2>Comments</h2>
@@ -81,10 +89,12 @@ export default class SimpleCommentScreen extends React.Component {
8189
isSaving={this.state.isSaving}
8290
actions={{ submitComment: this._handleCommentSubmit }}
8391
error={this.state.submitCommentError}
92+
cssTransitionGroupClassNames={cssTransitionGroupClassNames}
8493
/>
8594
<CommentList
8695
$$comments={this.state.$$comments}
8796
error={this.state.fetchCommentsError}
97+
cssTransitionGroupClassNames={cssTransitionGroupClassNames}
8898
/>
8999
</div>
90100
);
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.elementEnter {
2+
opacity: 0.01;
3+
4+
&.elementEnterActive {
5+
opacity: 1;
6+
transition: opacity 0.5s ease-in;
7+
}
8+
}
9+
10+
.elementLeave {
11+
opacity: 1;
12+
13+
&.elementLeaveActive {
14+
opacity: 0.01;
15+
transition: opacity 0.5s ease-in;
16+
}
17+
}

0 commit comments

Comments
 (0)