akkoma/priv/static/packs/features/directory.js

2 lines
9.5 KiB
JavaScript
Raw Normal View History

(window.webpackJsonp=window.webpackJsonp||[]).push([[22],{855:function(e,t,a){"use strict";a.r(t),a.d(t,"default",(function(){return G}));var o,n,c,i,r=a(0),s=a(2),l=(a(9),a(6),a(8)),d=a(1),u=a(3),b=a.n(u),m=a(15),f=a(7),j=a(5),g=a.n(j),h=a(762),p=a(759),O=a(253),v=a(207),_=a(4),M=a(21),w=a(16),y=a.n(w),k=a(210),C=a(115),I=a(122),N=a(300),L=a(109),E=a(53),R=a(22),P=a(421),q=a(26),A=a(48),F=a(212);var U=Object(f.f)({follow:{id:"account.follow",defaultMessage:"Follow"},unfollow:{id:"account.unfollow",defaultMessage:"Unfollow"},requested:{id:"account.requested",defaultMessage:"Awaiting approval"},unblock:{id:"account.unblock",defaultMessage:"Unblock @{name}"},unmute:{id:"account.unmute",defaultMessage:"Unmute @{name}"},unfollowConfirm:{id:"confirmations.unfollow.confirm",defaultMessage:"Unfollow"}}),T=(o=Object(m.connect)((function(){var e=Object(k.d)();return function(t,a){var o=a.id;return{account:e(t,o)}}}),(function(e,t){var a=t.intl;return{onFollow:function(t){t.getIn(["relationship","following"])||t.getIn(["relationship","requested"])?R.v?e(Object(A.d)("CONFIRM",{message:Object(r.a)(f.b,{id:"confirmations.unfollow.message",defaultMessage:"Are you sure you want to unfollow {name}?",values:{name:Object(r.a)("strong",{},void 0,"@",t.get("acct"))}}),confirm:a.formatMessage(U.unfollowConfirm),onConfirm:function(){return e(Object(q.K)(t.get("id")))}})):e(Object(q.K)(t.get("id"))):e(Object(q.F)(t.get("id")))},onBlock:function(t){t.getIn(["relationship","blocking"])?e(Object(q.J)(t.get("id"))):e(Object(q.w)(t.get("id")))},onMute:function(t){t.getIn(["relationship","muting"])?e(Object(q.L)(t.get("id"))):e(Object(F.g)(t))}}})),Object(f.g)(n=o((i=c=function(e){Object(l.a)(a,e);var t;t=a;function a(){for(var t,a=arguments.length,o=new Array(a),n=0;n<a;n++)o[n]=arguments[n];return t=e.call.apply(e,[this].concat(o))||this,Object(d.a)(Object(s.a)(t),"handleEmojiMouseEnter",(function(e){var t=e.target;t.src=t.getAttribute("data-original")})),Object(d.a)(Object(s.a)(t),"handleEmojiMouseLeave",(function(e){var t=e.target;t.src=t.getAttribute("data-static")})),Object(d.a)(Object(s.a)(t),"handleFollow",(function(){t.props.onFollow(t.props.account)})),Object(d.a)(Object(s.a)(t),"handleBlock",(function(){t.props.onBlock(t.props.account)})),Object(d.a)(Object(s.a)(t),"handleMute",(function(){t.props.onMute(t.props.account)})),Object(d.a)(Object(s.a)(t),"setRef",(function(e){t.node=e})),t}var o=a.prototype;return o._updateEmojis=function(){var e=this.node;if(e&&!R.a)for(var t=e.querySelectorAll(".custom-emoji"),a=0;a<t.length;a++){var o=t[a];o.classList.contains("status-emoji")||(o.classList.add("status-emoji"),o.addEventListener("mouseenter",this.handleEmojiMouseEnter,!1),o.addEventListener("mouseleave",this.handleEmojiMouseLeave,!1))}},o.componentDidMount=function(){this._updateEmojis()},o.componentDidUpdate=function(){this._updateEmojis()},o.render=function(){var e,t=this.props,a=t.account,o=t.intl;if(a.get("id")!==R.n&&null!==a.get("relationship",null)){var n=a.getIn(["relationship","following"]),c=a.getIn(["relationship","requested"]),i=a.getIn(["relationship","blocking"]),s=a.getIn(["relationship","muting"]);c?e=Object(r.a)(E.a,{disabled:!0,icon:"hourglass",title:o.formatMessage(U.requested)}):i?e=Object(r.a)(E.a,{active:!0,icon:"unlock",title:o.formatMessage(U.unblock,{name:a.get("username")}),onClick:this.handleBlock}):s?e=Object(r.a)(E.a,{active:!0,icon:"volume-up",title:o.formatMessage(U.unmute,{name:a.get("username")}),onClick:this.handleMute}):a.get("moved")&&!n||(e=Object(r.a)(E.a,{icon:n?"user-times":"user-plus",title:o.formatMessage(n?U.unfollow:U.follow),onClick:this.handleFollow,active:n}))}return(Object(r.a)("div",{className:"directory__card"},void 0,Object(r.a)("div",{className:"directory__card__img"},void 0,Object(r.a)("img",{src:R.a?a.get("header"):a.get("header_static"),alt:""})),Object(r.a)("div",{className:"directory__card__bar"},void 0,Object(r.a)(N.a,{className:"directory__card__bar__name",href:a.get("url"),to:"/accounts/"+a.get("id")},void 0,Object(r.a)(C.a,{account:a,size:48}),Object(r.a)(I.a,{account:a})),Object
//# sourceMappingURL=directory.js.map