{"version":3,"sources":["../../../src/components/CommentBox/index.js"],"names":["CommentBox","props","state","showReply","page","handleToggleReply","bind","handleGetMoreReply","renderReplies","setState","commentId","app","sGetReply","replies","replyCount","isNoMoreReply","length","len","marginLeft","map","item","index","id","float","content","reply_count","Component","propTypes","PropTypes","string","isRequired","defaultProps"],"mappings":";;;;;;;;;;;;;;AAAA;;;;AACA;;;;AAEA;;;;AACA;;;;AACA;;;;;;;;;;IAEMA,U;;;AACJ,sBAAYC,KAAZ,EAAmB;AAAA;;AAAA,wHACXA,KADW;;AAEjB,UAAKC,KAAL,GAAa;AACXC,iBAAW,IADA;AAEXC,YAAM;AAFK,KAAb;;AAKA,UAAKC,iBAAL,GAAyB,MAAKA,iBAAL,CAAuBC,IAAvB,OAAzB;AACA,UAAKC,kBAAL,GAA0B,MAAKA,kBAAL,CAAwBD,IAAxB,OAA1B;AACA,UAAKE,aAAL,GAAqB,MAAKA,aAAL,CAAmBF,IAAnB,OAArB;AATiB;AAUlB;;AAED;;;;;;;wCAGoB;AAClB,WAAKG,QAAL,CAAc,EAAEN,WAAW,CAAC,KAAKD,KAAL,CAAWC,SAAzB,EAAd;AACD;;AAED;;;;;;;uCAImBO,S,EAAW;AAC5B;AAD4B,UAEpBN,IAFoB,GAEX,KAAKF,KAFM,CAEpBE,IAFoB;;AAG5B,WAAKH,KAAL,CAAWU,GAAX,CAAeC,SAAf,CAAyB,EAAEF,oBAAF,EAAaN,UAAb,EAAzB;AACA,WAAKK,QAAL,CAAc,EAAEL,MAAMA,OAAO,CAAf,EAAd;AACD;;AAED;;;;;;;;;kCAMcS,O,EAASC,U,EAAYC,a,EAAe;AAAA;;AAAA,UACxCL,SADwC,GAC1B,KAAKT,KADqB,CACxCS,SADwC;AAAA,UAExCP,SAFwC,GAE1B,KAAKD,KAFqB,CAExCC,SAFwC;;AAGhD,UAAIA,aAAaU,OAAb,IAAwBA,QAAQG,MAApC,EAA4C;AAC1C,YAAMC,MAAMJ,QAAQG,MAApB;AACA,eACE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ECW,QAAQC,WAFT,EAGCD,QAAQT,aAHT;AARH,OADF;AAgBD;;;;EA7GsBW,gB;;AAgHzB1B,WAAW2B,SAAX,GAAuB;AACrBjB,aAAWkB,oBAAUC,MAAV,CAAiBC;AADP,CAAvB;;AAIA9B,WAAW+B,YAAX,GAA0B,EAA1B;;kBAEe,uBAAQ/B,UAAR,C","file":"index.js","sourcesContent":["import React, { Component } from \"react\";\r\nimport PropTypes from \"prop-types\";\r\nimport { Icon } from \"antd\";\r\nimport Comment from \"../../Comment\";\r\nimport ContentItem from \"./../ContentItem\";\r\nimport \"./index.css\";\r\n\r\nclass CommentBox extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n showReply: true,\r\n page: 1\r\n };\r\n\r\n this.handleToggleReply = this.handleToggleReply.bind(this);\r\n this.handleGetMoreReply = this.handleGetMoreReply.bind(this);\r\n this.renderReplies = this.renderReplies.bind(this);\r\n }\r\n\r\n /**\r\n * 切换是否显示回复列表\r\n */\r\n handleToggleReply() {\r\n this.setState({ showReply: !this.state.showReply });\r\n }\r\n\r\n /**\r\n * 获取更多评论\r\n * @param {string} commentId comment id\r\n */\r\n handleGetMoreReply(commentId) {\r\n // 从第一页开始获取评论\r\n const { page } = this.state;\r\n this.props.app.sGetReply({ commentId, page });\r\n this.setState({ page: page + 1 });\r\n }\r\n\r\n /**\r\n * 渲染回复 DOM\r\n * @param {array} replies 回复列表\r\n * @param {number} replies 回复的数量\r\n * @param {boolean} isNoMoreReply 是否没有更多回复\r\n */\r\n renderReplies(replies, replyCount, isNoMoreReply) {\r\n const { commentId } = this.props;\r\n const { showReply } = this.state;\r\n if (showReply && replies && replies.length) {\r\n const len = replies.length;\r\n return (\r\n