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

2 lines
9.4 KiB
JavaScript
Raw Normal View History

2020-01-22 07:00:23 -08:00
(window.webpackJsonp=window.webpackJsonp||[]).push([[29],{754:function(e,t,a){"use strict";a.r(t);var o,n,c,i,s,r,l,d=a(0),u=a(2),b=a(7),m=a(1),j=a(3),f=a.n(j),g=a(12),h=a(6),p=a(5),O=a.n(p),v=a(667),_=a(664),M=a(243),w=a(199),y=a(4),k=a(19),C=a(18),I=a.n(C),N=a(148),L=a(92),E=a(94),R=a(218),P=a(97),q=a(40),A=a(15),F=a(407),S=a(23),T=a(42),U=a(117),B=Object(h.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}"}}),D=(o=Object(g.connect)(function(){var e=Object(N.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"])?A.s?e(Object(T.d)("CONFIRM",{message:Object(d.a)(h.b,{id:"confirmations.unfollow.message",defaultMessage:"Are you sure you want to unfollow {name}?",values:{name:Object(d.a)("strong",{},void 0,"@",t.get("acct"))}}),confirm:a.formatMessage(B.unfollowConfirm),onConfirm:function(){return e(Object(S.S)(t.get("id")))}})):e(Object(S.S)(t.get("id"))):e(Object(S.M)(t.get("id")))},onBlock:function(t){t.getIn(["relationship","blocking"])?e(Object(S.R)(t.get("id"))):e(Object(S.z)(t.get("id")))},onMute:function(t){t.getIn(["relationship","muting"])?e(Object(S.T)(t.get("id"))):e(Object(U.g)(t))}}}),Object(h.g)(n=o((i=c=function(e){function t(){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(m.a)(Object(u.a)(t),"handleEmojiMouseEnter",function(e){var t=e.target;t.src=t.getAttribute("data-original")}),Object(m.a)(Object(u.a)(t),"handleEmojiMouseLeave",function(e){var t=e.target;t.src=t.getAttribute("data-static")}),Object(m.a)(Object(u.a)(t),"handleFollow",function(){t.props.onFollow(t.props.account)}),Object(m.a)(Object(u.a)(t),"handleBlock",function(){t.props.onBlock(t.props.account)}),Object(m.a)(Object(u.a)(t),"handleMute",function(){t.props.onMute(t.props.account)}),Object(m.a)(Object(u.a)(t),"setRef",function(e){t.node=e}),t}Object(b.a)(t,e);var a=t.prototype;return a._updateEmojis=function(){var e=this.node;if(e&&!A.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))}},a.componentDidMount=function(){this._updateEmojis()},a.componentDidUpdate=function(){this._updateEmojis()},a.render=function(){var e,t=this.props,a=t.account,o=t.intl;if(a.get("id")!==A.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(d.a)(q.a,{disabled:!0,icon:"hourglass",title:o.formatMessage(B.requested)}):i?e=Object(d.a)(q.a,{active:!0,icon:"unlock",title:o.formatMessage(B.unblock,{name:a.get("username")}),onClick:this.handleBlock}):s?e=Object(d.a)(q.a,{active:!0,icon:"volume-up",title:o.formatMessage(B.unmute,{name:a.get("username")}),onClick:this.handleMute}):a.get("moved")&&!n||(e=Object(d.a)(q.a,{icon:n?"user-times":"user-plus",title:o.formatMessage(n?B.unfollow:B.follow),onClick:this.handleFollow,active:n}))}return Object(d.a)("div",{className:"directory__card"},void 0,Object(d.a)("div",{className:"directory__card__img"},void 0,Object(d.a)("img",{src:A.a?a.get("header"):a.get("header_static"),alt:""})),Object(d.a)("div",{className:"directory__card__bar"},void 0,Object(d.a)(R.a,{className:"directory__card__bar__name",href:a.get("url"),to:"/accounts/"+a.get("id")},void 0,Object(d.a)(L.a,{account:a,size:48}),Object(d.a)(E.a,{account:a})),Object(d.a)("div",{className:"directory__card__bar__relationship account__relationship"},void 0,e)),f.a.createElement("div",{className:"directory__card__extra",ref:t
//# sourceMappingURL=directory.js.map