123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- import React, { Component } from "react";
- import { Spin } from "antd";
- import Comment from "../../Comment";
- import CommentBox from "../CommentBox";
- import "./index.css";
-
- class CommentList extends Component {
- constructor(props) {
- super(props);
- this.state = {};
- }
-
- componentWillMount() {
- this.props.app.sGetComment();
- }
-
- render() {
- const {
- list,
- page,
- loading,
- isNoMoreComment,
- sGetComment
- } = this.props.app;
-
- const spinning = Boolean(loading.sGetComment || loading.sCommentFavor);
- return (
- <div>
- <Spin spinning={spinning}>
- {list.map(item => (
- <CommentBox content={item} key={item.id} commentId={item.id} />
- ))}
-
- {!isNoMoreComment && (
- <div
- className="showMore"
- onClick={() => sGetComment({ page: page + 1 })}
- >
- <span>查看更多评论</span>
- </div>
- )}
- </Spin>
- </div>
- );
- }
- }
-
- CommentList.propTypes = {};
-
- export default Comment(CommentList);
|