1 |
- {"version":3,"sources":["../../../src/components/ContentItem/AvatarHoverCard.js"],"names":["AvatarHoverCard","props","state","showModal","isLogin","currentUser","user_id","getUserInfo","id","noCheckFollowed","image","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,UAAMC,UAAU,KAAKH,KAAL,CAAWI,WAAX,CAAuBC,OAAvB,GAAiC,CAAjD;AACA,WAAKL,KAAL,CAAWM,WAAX,CAAuB;AACrBC,YAAI,KAAKP,KAAL,CAAWK,OADM;AAErBG,yBAAiB,CAACL;AAFG,OAAvB;AAID;;;6BAEQ;AAAA;;AAAA,mBACmD,KAAKH,KADxD;AAAA,UACCS,KADD,UACCA,KADD;AAAA,UACQJ,OADR,UACQA,OADR;AAAA,UACiBD,WADjB,UACiBA,WADjB;AAAA,UAC8BM,gBAD9B,UAC8BA,gBAD9B;;AAEP,UAAMC,WACJD,iBAAiBL,OAAjB,KAA6BK,iBAAiBL,OAAjB,EAA0BO,UADzD;;AAGA,aACE;AAAA;AAAA,UAAK,WAAU,iBAAf,EAAiC,SAAS;AAAA,mBAAKC,EAAEC,eAAF,EAAL;AAAA,WAA1C;AAEE;AAAA;AAAA,YAAK,SAAS;AAAA,qBAAM,OAAKd,KAAL,CAAWe,YAAX,CAAwBV,OAAxB,CAAN;AAAA,aAAd;AACE;AAAA;AAAA,cAAK,MAAK,MAAV,EAAiB,WAAU,SAA3B;AACE;AACE,yBAAU,QADZ;AAEE,qBAAO;AACLW,0CAAwBP,KAAxB;AADK;AAFT,cADF;AAOE;AAAA;AAAA,gBAAK,WAAU,UAAf;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yBAAKxB,KAAL,CAAWM,WAAX,CAAuB;AACrBC,wBAAIF;AADiB,mBAAvB;AAGD,iBARH;AASD;AAbH;AAeGc,yCAAKC,GAAL,CAAS,2BAAT;AAfH,WADD,GAmBC;AAAA;AAAA;AACE,yBAAU,WADZ;AAEE,uBAAS,oBAAK;AACZP,kBAAEC,eAAF;AACA,uBAAKd,KAAL,CAAWyB,KAAX,CAAiB,EAAElB,IAAIF,OAAN,EAAjB,EAAkCmB,IAAlC,CAAuC,YAAM;AAC3C,yBAAKxB,KAAL,CAAWM,WAAX,CAAuB;AACrBC,wBAAIF;AADiB,mBAAvB;AAGD,iBAJD;AAKD;AATH;AAWGc,yCAAKC,GAAL,CAAS,oBAAT,EAA+B,EAAEC,KAAK,EAAP,EAA/B;AAXH;AApBJ;AAjDJ,OADF;AAgGD;;;;EArH2BK,gB;;kBAwHf3B,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 const isLogin = this.props.currentUser.user_id > 0;\n this.props.getUserInfo({\n id: this.props.user_id,\n noCheckFollowed: !isLogin\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 > 0 && 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"]}
|