(window.webpackJsonp=window.webpackJsonp||[]).push([[29],{1029:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return C}));var o,i=n(0),s=n(1),c=n.n(s),a=n(12),l=n(4),d=n(3),m=n.n(d),r=n(1329),u=n(961),h=n(958),p=n(24),g=n(271),y=n(1328);let b=Object(l.g)(o=class extends c.a.PureComponent{render(){const{settings:e,onChange:t}=this.props;return Object(i.a)("div",{},void 0,Object(i.a)("div",{className:"column-settings__row"},void 0,Object(i.a)(y.a,{settings:e,settingPath:["other","onlyMedia"],onChange:t,label:Object(i.a)(l.b,{id:"community.column_settings.media_only",defaultMessage:"Media only"})})))}})||o;var M=n(59);var j,O,I=Object(a.connect)(((e,t)=>{let{columnId:n}=t;const o=n,i=e.getIn(["settings","columns"]),s=i.findIndex((e=>e.get("uuid")===o));return{settings:o&&s>=0?i.get(s).get("params"):e.getIn(["settings","community"])}}),((e,t)=>{let{columnId:n}=t;return{onChange(t,o){e(n?Object(g.f)(n,t,o):Object(M.c)(["community",...t],o))}}}))(b),f=n(967);const v=Object(l.f)({title:{id:"column.community",defaultMessage:"Local timeline"}});let C=Object(a.connect)(((e,t)=>{let{columnId:n}=t;const o=n,i=e.getIn(["settings","columns"]),s=i.findIndex((e=>e.get("uuid")===o)),c=n&&s>=0?i.get(s).getIn(["params","other","onlyMedia"]):e.getIn(["settings","community","other","onlyMedia"]),a=e.getIn(["timelines","community"+(c?":media":"")]);return{hasUnread:!!a&&a.get("unread")>0,onlyMedia:c}}))(j=Object(l.g)(((O=class extends c.a.PureComponent{constructor(){super(...arguments),this.handlePin=()=>{const{columnId:e,dispatch:t,onlyMedia:n}=this.props;t(e?Object(g.h)(e):Object(g.e)("COMMUNITY",{other:{onlyMedia:n}}))},this.handleMove=e=>{const{columnId:t,dispatch:n}=this.props;n(Object(g.g)(t,e))},this.handleHeaderClick=()=>{this.column.scrollTop()},this.setRef=e=>{this.column=e},this.handleLoadMore=e=>{const{dispatch:t,onlyMedia:n}=this.props;t(Object(p.s)({maxId:e,onlyMedia:n}))}}componentDidMount(){const{dispatch:e,onlyMedia:t}=this.props;e(Object(p.s)({onlyMedia:t})),this.disconnect=e(Object(f.a)({onlyMedia:t}))}componentDidUpdate(e){if(e.onlyMedia!==this.props.onlyMedia){const{dispatch:e,onlyMedia:t}=this.props;this.disconnect(),e(Object(p.s)({onlyMedia:t})),this.disconnect=e(Object(f.a)({onlyMedia:t}))}}componentWillUnmount(){this.disconnect&&(this.disconnect(),this.disconnect=null)}render(){const{intl:e,hasUnread:t,columnId:n,multiColumn:o,onlyMedia:s}=this.props,a=!!n;return c.a.createElement(u.a,{bindToDocument:!o,ref:this.setRef,label:e.formatMessage(v.title)},Object(i.a)(h.a,{icon:"users",active:t,title:e.formatMessage(v.title),onPin:this.handlePin,onMove:this.handleMove,onClick:this.handleHeaderClick,pinned:a,multiColumn:o},void 0,Object(i.a)(I,{columnId:n})),Object(i.a)(r.a,{trackScroll:!a,scrollKey:"community_timeline-"+n,timelineId:"community"+(s?":media":""),onLoadMore:this.handleLoadMore,emptyMessage:Object(i.a)(l.b,{id:"empty_column.community",defaultMessage:"The local timeline is empty. Write something publicly to get the ball rolling!"}),bindToDocument:!o}))}}).contextTypes={router:m.a.object},O.defaultProps={onlyMedia:!1},j=O))||j)||j}}]);
//# sourceMappingURL=community_timeline-818360c2271fe1c9d248.chunk.js.map