text: webpackJsonp([4],{1005:function(t,e,o){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function s(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function l(t,e){return{post:(0,E.getPost)(t,e.params.cuid),showEditPost:(0,v.getShowEditPost)(t)}}function p(t,e){return{toggleEditPost:function(){return t((0,F.toggleEditPost)())},editPostRequest:function(o){return t((0,C.editPostRequest)(e.params.cuid,o))}}}Object.defineProperty(e,"__esModule",{value:!0}),e.PostDetailPage=void 0;var u=function(){var t="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103;return function(e,o,n,s){var a=e&&e.defaultProps,r=arguments.length-3;if(o||0===r||(o={}),o&&a)for(var i in a)void 0===o[i]&&(o[i]=a[i]);else o||(o=a||{});if(1===r)o.children=s;else if(r>1){for(var l=Array(r),p=0;p<r;p++)l[p]=arguments[p+3];o.children=l}return{$$typeof:t,type:e,key:void 0===n?null:""+n,ref:null,props:o,_owner:null}}}(),d=function(){function t(t,e){for(var o=0;o<e.length;o++){var n=e[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,o,n){return o&&t(e.prototype,o),n&&t(e,n),e}}(),c=o(1),f=n(c),m=o(107),h=o(379),b=n(h),g=o(105),v=o(376),P=o(106),_=o(231),y=o(1008),w=n(y),C=o(377),E=o(378),F=o(232),N=u(g.FormattedMessage,{id:"editPost"}),k=u(g.FormattedMessage,{id:"accept"}),O=u(g.FormattedMessage,{id:"cancel"}),M=u(g.FormattedMessage,{id:"editPost"}),U=u(_.FontAwesomeIcon,{icon:"pencil-alt"}),j=u(g.FormattedMessage,{id:"by"}),x=e.PostDetailPage=function(t){function e(t){a(this,e);var o=r(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return o.handleInputChange=function(t){var e=t.target,n=e.value,a=e.name;o.setState(s({},a,n))},o.handleEditPost=function(){o.props.toggleEditPost(),o.props.editPostRequest(o.state)},o.handleCancelPost=function(){o.props.toggleEditPost()},o.renderPostForm=function(){return u("div",{className:w["default"]["form-content"]},void 0,u("h2",{className:w["default"]["form-title"]},void 0,N),u("input",{placeholder:o.props.intl.messages.authorName,className:w["default"]["form-field"],name:"name",value:o.state.name,onChange:o.handleInputChange,type:"text"}),u("input",{placeholder:o.props.intl.messages.postTitle,className:w["default"]["form-field"],name:"title",value:o.state.title,onChange:o.handleInputChange,type:"text"}),u("textarea",{placeholder:o.props.intl.messages.postContent,className:w["default"]["form-field"],name:"content",value:o.state.content,onChange:o.handleInputChange}),u("a",{className:"btn btn-success",href:"#",onClick:o.handleEditPost},void 0,k),u("a",{className:w["default"]["cancel-post-button"]+" btn btn-danger",href:"#",onClick:o.handleCancelPost},void 0,O))},o.renderPost=function(){return u("div",{className:"container "+w["default"]["full-height"]},void 0,u("div",{className:w["default"]["single-post"]+" "+w["default"]["post-detail"]},void 0,u(P.Link,{to:"/",className:w["default"]["edit-post-button"]+" btn btn-primary"},void 0," Back"),u("a",{className:w["default"]["edit-post-button"]+" btn btn-warning",href:"#",onClick:o.props.toggleEditPost},void 0,M,U),u("h3",{className:w["default"]["post-title"]},void 0,o.props.post.title),u("p",{className:w["default"]["author-name"]},void 0,j," ",o.props.post.name),u("p",{className:w["default"]["post-desc-inside"]},void 0,o.props.post.content)))},o.state={name:o.props.post.name,title:o.props.post.title,content:o.props.post.content,votes:o.props.post.votes},o}return i(e,t),d(e,[{key:"render",value:function(){return u("div",{},void 0,u(b["default"],{title:this.props.post.title}),u("div",{className:w["default"]["edit-post-wrapper"]},void 0),this.props.showEditPost?this.renderPostForm():this.renderPost())}}]),e}(f["default"].Component);x.need=[function(t){return(0,C.fetchPost)(t.cuid)}],e["default"]=(0,m.connect)(l,p)((0,g.injectIntl)(x))},1008:function(t,e){t.exports={"full-height":"_1GjG4WUiwlKVAm29xdhUd-","list-view":"_4UUgkjTIKasBiRWgL_2Uq","edit-post-wrapper":"_3i7OyciAsEv6LVDBFOzNXQ","edit-post-button":"_28MH_jrCf9XkXp2I8bJhk","cancel-post-button":"_1Lc_VRAeFlwSWQjB5xHgUb",form:"R_mEdiCpyHaYTYsKoni8n","form-content":"_1y7Rs59wtq1EX91ZBhURLy","form-title":"_10J2zs5FWaJQJBgQF19sQU","form-field":"_3TEW0SrLL1iG0okBmDxPF-",appear:"OdMDDK0IReiOqFx23M2HU","single-post":"_2wFZUrnLLPIM2UvuNgnV1r","post-title":"_1BU3HyU1b5fh1tsPA9MtRq","author-name":"_2pYEGhQRMs0Mh9CsoJsCrq","post-desc-inside":"_1Tz6MI2Lx8k_honCeAXX_-","post-desc":"_2hG8tPFCGI0k7BZ5cz9nnH","post-action":"_37qYFcYfJHxrTH_bV6-TQo",divider:"_3H_6OlXO_Hx_93avyoPoZ2","post-detail":"_16xorg78DM6DwmPTBglw02",thumbs:"btSrW-jkNbAiMEdFnkPOl",thumbUp:"_3YX-d-1m6Ebp5vkaFzOCca",thumbDown:"dHEY839LnKqA1s-UAX0XA"}}});