pleroma/priv/static/packs/flavours/glitch/async/drawer.js
2019-01-31 10:35:44 +01:00

2 lines
6.5 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[49],{704:function(e,t,a){"use strict";a.r(t);var j=a(1),i=a(6),n=a(3),c=a.n(n),r=a(7),s=a(12),h=a.n(s),o=a(44),l=a(87),p=a(653),_=a(948),u=a(386),d=a(204),b=a(95),g=a(138),m=Object(r.f)({community:{id:"navigation_bar.community_timeline",defaultMessage:"Local timeline"},home_timeline:{id:"tabs_bar.home",defaultMessage:"Home"},logout:{id:"navigation_bar.logout",defaultMessage:"Logout"},notifications:{id:"tabs_bar.notifications",defaultMessage:"Notifications"},public:{id:"navigation_bar.public_timeline",defaultMessage:"Federated timeline"},settings:{id:"navigation_bar.app_settings",defaultMessage:"App settings"},start:{id:"getting_started.heading",defaultMessage:"Getting started"}});function M(e){var a=e.columns,t=e.unreadNotifications,i=e.showNotificationsBadge,n=e.intl,s=e.onSettingsClick,o=b.b.bind(null,function(t){return!a||!a.some(function(e){return e.get("id")===t})});return Object(j.a)("nav",{className:"drawer--header"},void 0,Object(j.a)(u.a,{"aria-label":n.formatMessage(m.start),title:n.formatMessage(m.start),to:"/getting-started"},void 0,Object(j.a)(d.a,{icon:"asterisk"})),o("HOME",Object(j.a)(u.a,{"aria-label":n.formatMessage(m.home_timeline),title:n.formatMessage(m.home_timeline),to:"/timelines/home"},void 0,Object(j.a)(d.a,{icon:"home"}))),o("NOTIFICATIONS",Object(j.a)(u.a,{"aria-label":n.formatMessage(m.notifications),title:n.formatMessage(m.notifications),to:"/notifications"},void 0,Object(j.a)("span",{className:"icon-badge-wrapper"},void 0,Object(j.a)(d.a,{icon:"bell"}),i&&0<t&&Object(j.a)("div",{className:"icon-badge"})))),o("COMMUNITY",Object(j.a)(u.a,{"aria-label":n.formatMessage(m.community),title:n.formatMessage(m.community),to:"/timelines/public/local"},void 0,Object(j.a)(d.a,{icon:"users"}))),o("PUBLIC",Object(j.a)(u.a,{"aria-label":n.formatMessage(m.public),title:n.formatMessage(m.public),to:"/timelines/public"},void 0,Object(j.a)(d.a,{icon:"globe"}))),Object(j.a)("a",{"aria-label":n.formatMessage(m.settings),onClick:s,href:"#",title:n.formatMessage(m.settings)},void 0,Object(j.a)(d.a,{icon:"cogs"})),Object(j.a)("a",{"aria-label":n.formatMessage(m.logout),"data-method":"delete",href:g.d,title:n.formatMessage(m.logout)},void 0,Object(j.a)(d.a,{icon:"sign-out"})))}var f=a(32),O=a(45),v=a.n(O),N=a(624),w=a(632),C=a(949),y=a(319),I=function(e){return e<1e3?Object(j.a)(r.c,{value:e}):Object(j.a)(n.Fragment,{},void 0,Object(j.a)(r.c,{value:e/1e3,maximumFractionDigits:1}),"K")},S=function(e){var t=e.hashtag;return Object(j.a)("div",{className:"trends__item"},void 0,Object(j.a)("div",{className:"trends__item__name"},void 0,Object(j.a)(y.a,{href:t.get("url"),to:"/timelines/tag/"+t.get("name")},void 0,"#",Object(j.a)("span",{},void 0,t.get("name"))),Object(j.a)(r.b,{id:"trends.count_by_accounts",defaultMessage:"{count} {rawCount, plural, one {person} other {people}} talking",values:{rawCount:t.getIn(["history",0,"accounts"]),count:Object(j.a)("strong",{},void 0,I(t.getIn(["history",0,"accounts"])))}})),Object(j.a)("div",{className:"trends__item__current"},void 0,I(t.getIn(["history",0,"uses"]))),Object(j.a)("div",{className:"trends__item__sparkline"},void 0,Object(j.a)(C.Sparklines,{width:50,height:28,data:t.get("history")&&t.get("history").reverse().map(function(e){return e.get("uses")}).toArray()},void 0,Object(j.a)(C.SparklinesCurve,{style:{fill:"none"}}))))},k=a(107),T=Object(r.f)({total:{id:"search_results.total",defaultMessage:"{count, number} {count, plural, one {result} other {results}}"}});function z(e){var t=e.results,a=e.visible,i=t?t.get("accounts"):null,n=t?t.get("statuses"):null,s=t?t.get("hashtags"):null,o=[i,n,s].reduce(function(e,t){return t&&t.size?e+t.size:e},0);return Object(j.a)(k.a,{defaultStyle:{x:-100},style:{x:v()(a?0:-100,{stiffness:210,damping:20})}},void 0,function(e){var t=e.x;return Object(j.a)("div",{className:"drawer--results",style:{transform:"translateX("+t+"%)",visibility:-100===t?"hidden":"visible"}},void 0,Object(j.a)("header",{},void 0,c.a.createElement(r.b,Object(f.a)({},T.total,{values:{count:o}}))),i&&i.size?Object(j.a)("section",{},void 0,Object(j.a)("h5",{},void 0,Object(j.a)(r.b,{id:"search_results.accounts",defaultMessage:"People"})),i.map(function(e){return Object(j.a)(N.a,{id:e},e)})):null,n&&n.size?Object(j.a)("section",{},void 0,Object(j.a)("h5",{},void 0,Object(j.a)(r.b,{id:"search_results.statuses",defaultMessage:"Toots"})),n.map(function(e){return Object(j.a)(w.a,{id:e},e)})):null,s&&s.size?Object(j.a)("section",{},void 0,Object(j.a)("h5",{},void 0,Object(j.a)(r.b,{id:"search_results.hashtags",defaultMessage:"Hashtags"})),s.map(function(e){return Object(j.a)(S,{hashtag:e},e.get("name"))})):null)})}var B=a(971),H=a(30),x=a(650);a.d(t,"WrappedComponent",function(){return P});var F=Object(r.f)({compose:{id:"navigation_bar.compose",defaultMessage:"Compose new toot"}}),P=function(t){function e(e){return t.call(this,e)||this}return Object(i.a)(e,t),e.prototype.render=function(){var e=this.props,t=e.account,a=e.columns,i=e.intl,n=e.multiColumn,s=e.onChange,o=e.onClear,c=e.onOpenSettings,r=e.onShow,l=e.onSubmit,u=e.results,d=e.searchHidden,b=e.searchValue,g=e.submitted,m=e.isSearchPage,f=e.unreadNotifications,O=e.showNotificationsBadge,v=h()("drawer","mbstobon");return Object(j.a)("div",{className:v,role:"region","aria-label":i.formatMessage(F.compose)},void 0,n?Object(j.a)(M,{columns:a,unreadNotifications:f,showNotificationsBadge:O,intl:i,onSettingsClick:c}):null,(n||m)&&Object(j.a)(B.a,{intl:i,onChange:s,onClear:o,onShow:r,onSubmit:l,submitted:g,value:b}),Object(j.a)("div",{className:"drawer__pager"},void 0,!m&&Object(j.a)("div",{className:"drawer__inner"},void 0,Object(j.a)(_.a,{account:t}),Object(j.a)(p.b,{}),n&&H.j&&Object(j.a)("div",{className:"drawer__inner__mastodon"},void 0,Object(j.a)("img",{alt:"",draggable:"false",src:H.j}))),(n||m)&&Object(j.a)(z,{results:u,visible:g&&!d})))},e}(c.a.Component);t.default=Object(x.a)(P,function(e){return{account:e.getIn(["accounts",H.l]),columns:e.getIn(["settings","columns"]),results:e.getIn(["search","results"]),searchHidden:e.getIn(["search","hidden"]),searchValue:e.getIn(["search","value"]),submitted:e.getIn(["search","submitted"]),unreadNotifications:e.getIn(["notifications","unread"]),showNotificationsBadge:e.getIn(["local_settings","notifications","tab_badge"])}},function(t,e){e.intl;return{onChange:function(e){t(Object(l.e)(e))},onClear:function(){t(Object(l.f)())},onShow:function(){t(Object(l.g)())},onSubmit:function(){t(Object(l.h)())},onOpenSettings:function(e){e.preventDefault(),e.stopPropagation(),t(Object(o.d)("SETTINGS",{}))}}},!0)}}]);
//# sourceMappingURL=drawer.js.map