pleroma/priv/static/packs/features/glitch/async/directory.js

2 lines
9.6 KiB
JavaScript
Raw Normal View History

2020-05-20 01:55:14 -04:00
(window.webpackJsonp=window.webpackJsonp||[]).push([[31],{849: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(760),p=a(758),O=a(252),v=a(204),_=a(4),M=a(21),w=a(16),y=a.n(w),k=a(108),C=a(96),I=a(98),N=a(214),L=a(102),E=a(41),R=a(18),P=a(420),q=a(24),A=a(45),F=a(123);var S=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.s?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(S.unfollowConfirm),onConfirm:function(){return e(Object(q.S)(t.get("id")))}})):e(Object(q.S)(t.get("id"))):e(Object(q.M)(t.get("id")))},onBlock:function(t){t.getIn(["relationship","blocking"])?e(Object(q.R)(t.get("id"))):e(Object(q.z)(t.get("id")))},onMute:function(t){t.getIn(["relationship","muting"])?e(Object(q.T)(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.m&&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(S.requested)}):i?e=Object(r.a)(E.a,{active:!0,icon:"unlock",title:o.formatMessage(S.unblock,{name:a.get("username")}),onClick:this.handleBlock}):s?e=Object(r.a)(E.a,{active:!0,icon:"volume-up",title:o.formatMessage(S.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?S.unfollow:S.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(r
2020-01-22 10:00:23 -05:00
//# sourceMappingURL=directory.js.map