通用评论

AvatarHoverCard.js.map 6.4KB

1
  1. {"version":3,"sources":["../../../src/components/ContentItem/AvatarHoverCard.js"],"names":["AvatarHoverCard","props","state","showModal","getUserInfo","id","user_id","image","currentUser","userAvaHoverData","followed","isFollowed","e","stopPropagation","userAvaClick","backgroundImage","nickname","fans","intl","get","ext","followers","unFocus","then","focus","Component"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;AAEA;;;;AACA;;;;;;;;;;IAEMA,e;;;AACJ,2BAAYC,KAAZ,EAAmB;AAAA;;AAAA,kIACXA,KADW;;AAEjB,UAAKC,KAAL,GAAa;AACXC,iBAAW;AADA,KAAb;AAFiB;AAKlB;;;;wCAEmB;AAClB,WAAKF,KAAL,CAAWG,WAAX,CAAuB;AACrBC,YAAI,KAAKJ,KAAL,CAAWK;AADM,OAAvB;AAGD;;;6BAEQ;AAAA;;AAAA,mBACmD,KAAKL,KADxD;AAAA,UACCM,KADD,UACCA,KADD;AAAA,UACQD,OADR,UACQA,OADR;AAAA,UACiBE,WADjB,UACiBA,WADjB;AAAA,UAC8BC,gBAD9B,UAC8BA,gBAD9B;;AAEP,UAAMC,WACJD,iBAAiBH,OAAjB,KAA6BG,iBAAiBH,OAAjB,EAA0BK,UADzD;;AAGA,aACE;AAAA;AAAA,UAAK,WAAU,iBAAf,EAAiC,SAAS;AAAA,mBAAKC,EAAEC,eAAF,EAAL;AAAA,WAA1C;AAEE;AAAA;AAAA,YAAK,SAAS;AAAA,qBAAM,OAAKZ,KAAL,CAAWa,YAAX,CAAwBR,OAAxB,CAAN;AAAA,aAAd;AACE;AAAA;AAAA,cAAK,MAAK,MAAV,EAAiB,WAAU,SAA3B;AACE;AACE,yBAAU,QADZ;AAEE,qBAAO;AACLS,0CAAwBR,KAAxB;AADK;AAFT,cADF;AAOE;AAAA;AAAA,gBAAK,WAAU,UAAf;AACGE,+BAAiBH,OAAjB,KAA6BG,iBAAiBH,OAAjB,EAA0BU;AAD1D;AAPF;AADF,SAFF;AAgBE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,WADD,GAmBC;AAAA;AAAA;AACE,yBAAU,WADZ;AAEE,uBAAS,oBAAK;AACZP,kBAAEC,eAAF;AACA,uBAAKZ,KAAL,CAAWuB,KAAX,CAAiB,EAAEnB,IAAIC,OAAN,EAAjB,EAAkCiB,IAAlC,CAAuC,YAAM;AAC3C,yBAAKtB,KAAL,CAAWG,WAAX,CAAuB;AACrBC,wBAAIC;AADiB,mBAAvB;AAGD,iBAJD;AAKD;AATH;AAWGY,yCAAKC,GAAL,CAAS,oBAAT,EAA+B,EAAEC,KAAK,EAAP,EAA/B;AAXH;AApBJ;AAjDJ,OADF;AAgGD;;;;EAnH2BK,gB;;kBAsHfzB,e","file":"AvatarHoverCard.js","sourcesContent":["import React, { Component } from \"react\";\nimport { Row, Col } from \"antd\";\nimport intl from \"react-intl-universal\";\nimport \"./AvatarHoverCard.less\";\n\nclass AvatarHoverCard extends Component {\n constructor(props) {\n super(props);\n this.state = {\n showModal: false\n };\n }\n\n componentDidMount() {\n this.props.getUserInfo({\n id: this.props.user_id\n });\n }\n\n render() {\n const { image, user_id, currentUser, userAvaHoverData } = this.props;\n const followed =\n userAvaHoverData[user_id] && userAvaHoverData[user_id].isFollowed;\n\n return (\n <div className=\"AvatarHoverCard\" onClick={e => e.stopPropagation()}>\n {/* <Link to={`/bilingual/user/${user_id}`}> */}\n <div onClick={() => this.props.userAvaClick(user_id)}>\n <Row type=\"flex\" className=\"rowUser\">\n <div\n className=\"avatar\"\n style={{\n backgroundImage: `url(${image})`\n }}\n />\n <div className=\"nickname\">\n {userAvaHoverData[user_id] && userAvaHoverData[user_id].nickname}\n </div>\n </Row>\n </div>\n {/* </Link> */}\n <div className=\"divider\" />\n <Row type=\"flex\" className=\"rowNum\">\n <Col className=\"colFans\">\n <div className=\"count\">\n {userAvaHoverData[user_id] && userAvaHoverData[user_id].fans}\n </div>\n <div className=\"text\">\n {intl.get(\"bilingually.fan\", {\n ext:\n userAvaHoverData[user_id] &&\n userAvaHoverData[user_id].fans > 1\n ? \"s\"\n : \"\"\n })}\n </div>\n </Col>\n <Col className=\"hdivider\" />\n <Col className=\"colFollow\">\n <div className=\"count\">\n {userAvaHoverData[user_id] && userAvaHoverData[user_id].followers}\n </div>\n <div className=\"text\">\n {intl.get(\"bilingually.follow\", {\n ext:\n userAvaHoverData[user_id] &&\n userAvaHoverData[user_id].followers > 1\n ? \"s\"\n : \"\"\n })}\n </div>\n </Col>\n </Row>\n {currentUser.user_id !== user_id && (\n <Row type=\"flex\" className=\"rowBtn\">\n {followed ? (\n <div\n className=\"unFollowBtn\"\n onClick={e => {\n e.stopPropagation();\n this.props\n .unFocus({\n id: user_id\n })\n .then(() => {\n this.props.getUserInfo({\n id: user_id\n });\n });\n }}\n >\n {intl.get(\"bilingually.cancel_follow\")}\n </div>\n ) : (\n <div\n className=\"followBtn\"\n onClick={e => {\n e.stopPropagation();\n this.props.focus({ id: user_id }).then(() => {\n this.props.getUserInfo({\n id: user_id\n });\n });\n }}\n >\n {intl.get(\"bilingually.follow\", { ext: \"\" })}\n </div>\n )}\n\n {/* 发私信按钮,暂时隐藏 */}\n {/* <div\n className={styles.privateMessageBtn}\n onClick={this.toggleShowModal}\n >\n 发私信\n </div> */}\n </Row>\n )}\n </div>\n );\n }\n}\n\nexport default AvatarHoverCard;\n"]}