honkoma/priv/static/packs/flavours/glitch/async/drawer.js

2 lines
6.6 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[50],{696:function(e,t,a){"use strict";a.r(t);var j=a(0),i=a(7),n=a(2),c=a.n(n),r=a(6),s=a(12),v=a.n(s),o=a(50),l=a(233),p=a(643),_=a(961),u=a(358),d=a(205),b=a(93),g=a(224),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(42),O=a(44),h=a.n(O),N=a(600),w=a(905),C=a(962),y=a(318),I=a(963),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,Object(I.a)(t.getIn(["history",0,"accounts"])))}})),Object(j.a)("div",{className:"trends__item__current"},void 0,Object(I.a)(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(105),x=Object(r.f)({total:{id:"search_results.total",defaultMessage:"{count, number} {count, plural, one {result} other {results}}"}});function T(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:h()(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,Object(j.a)(d.a,{icon:"search",fixedWidth:!0}),c.a.createElement(r.b,Object(f.a)({},x.total,{values:{count:o}}))),i&&i.size?Object(j.a)("section",{},void 0,Object(j.a)("h5",{},void 0,Object(j.a)(d.a,{icon:"users",fixedWidth:!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)(d.a,{icon:"quote-right",fixedWidth:!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)(d.a,{icon:"hashtag",fixedWidth:!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 z=a(988),B=a(29),H=a(640);a.d(t,"WrappedComponent",function(){return P});var W=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,h=v()("drawer","mbstobon");return Object(j.a)("div",{className:h,role:"region","aria-label":i.formatMessage(W.compose)},void 0,n?Object(j.a)(M,{columns:a,unreadNotifications:f,showNotificationsBadge:O,intl:i,onSettingsClick:c}):null,(n||m)&&Object(j.a)(z.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&&B.i&&Object(j.a)("div",{className:"drawer__inner__mastodon"},void 0,Object(j.a)("img",{alt:"",draggable:"false",src:B.i}))),(n||m)&&Object(j.a)(T,{results:u,visible:g&&!d})))},e}(c.a.Component);t.default=Object(H.a)(P,function(e){return{account:e.getIn(["accounts",B.k]),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