import { Component, PropTypes } from 'react'; import { I18n } from 'react-i18nify'; /** * A simple static component with the comment's order selector markup * @class * @augments Component * @todo Needs a proper implementation */ class CommentOrderSelector extends Component { constructor(props) { super(props); this.state = { orderBy: this.props.defaultOrderBy } } componentDidMount() { $(document).foundation(); } render() { const { orderBy } = this.state; return (
{ I18n.t("components.comment_order_selector.title") }
); } _updateOrder(event, orderBy) { event.preventDefault(); this.setState({ orderBy }); this.props.reorderComments(orderBy); } } CommentOrderSelector.propTypes = { reorderComments: PropTypes.func.isRequired, defaultOrderBy: PropTypes.string.isRequired }; export default CommentOrderSelector;