import BaseComponent from 'libs/components/BaseComponent'; import React, { PropTypes } from 'react'; import CommentForm from './CommentForm/CommentForm'; import CommentList from './CommentList/CommentList'; import css from './CommentBox.scss'; export default class CommentBox extends BaseComponent { static propTypes = { pollInterval: PropTypes.number.isRequired, actions: PropTypes.object.isRequired, data: PropTypes.object.isRequired, }; componentDidMount() { const { fetchComments } = this.props.actions; fetchComments(); this.intervalId = setInterval(fetchComments, this.props.pollInterval); } componentWillUnmount() { clearInterval(this.intervalId); } render() { const { actions, data } = this.props; const cssTransitionGroupClassNames = { enter: css.elementEnter, enterActive: css.elementEnterActive, leave: css.elementLeave, leaveActive: css.elementLeaveActive, }; return (
Text supports Github Flavored Markdown.
Comments older than 24 hours are deleted.
Name is preserved. Text is reset, between submits.