text: webpackHotUpdate(0,{119:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),a=n(1),l=(o=a)&&o.__esModule?o:{default:o},u=n(45);var c=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.state={},e.handleSubmit=e.handleSubmit.bind(e),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,a.Component),r(t,[{key:"handleSubmit",value:function(e){var t=this,n=new FormData(e.target);console.log(),$.ajax({type:"POST",url:loginPath,data:{_comment:n.get("comment"),_postID:t.props.postID},success:function(e){console.log(e),sessionStorage.setItem("api_token",e),t.userLogged(!0)},error:function(e){e.responseJSON&&console.log(e.responseJSON)}})}},{key:"render",value:function(){var e=this;return l.default.createElement(u.Row,{className:"addCommentRow"},l.default.createElement(u.Col,{sm:8},l.default.createElement(u.Panel,null,l.default.createElement(u.Panel.Heading,null,"Dodaj komentarz"),l.default.createElement(u.Panel.Body,null,l.default.createElement(u.Form,{onSubmit:function(t){t.preventDefault(),e.handleSubmit(t)}},l.default.createElement(u.FormGroup,{controlId:"formControlsTextarea"},l.default.createElement(u.FormControl,{componentClass:"textarea",name:"comment",placeholder:"Treść"})),l.default.createElement(u.Col,{className:"text-right",xs:12},l.default.createElement(u.Button,{type:"submit"},"Wyślij")))))),l.default.createElement(u.Col,{sm:4}))}}]),t}();t.default=c},89:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=n(1),a=s(r),l=n(44),u=s(n(119)),c=s(n(118));function s(e){return e&&e.__esModule?e:{default:e}}var i=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r.Component),o(t,[{key:"componentWillMount",value:function(){$.ajax({type:"POST",url:"/getdata"+window.location.pathname,success:function(e){console.log(JSON.parse(e)),e=JSON.parse(e),this.props.posts=e[0]},error:function(e){e.responseJSON&&console.log(e.responseJSON)}})}},{key:"render",value:function(){console.log("props: "+this.props.posts);var e=this.props.posts,t=this.props.match.params.slug,n=e.filter(function(e){if(e.slug==t)return e});return a.default.createElement("div",null,a.default.createElement("h1",null,n[0].title),a.default.createElement("div",{className:"row"},a.default.createElement("div",{className:"col-sm-6 col-md-4"},a.default.createElement("div",{className:"thumbnail"},a.default.createElement("img",{src:n[0].image,alt:n[0].title}))),a.default.createElement("div",{className:"col-sm-6 col-md-4"},a.default.createElement("p",null,n[0].description))),a.default.createElement("div",{className:"row"},a.default.createElement(c.default,null)),a.default.createElement("div",{className:"row"},a.default.createElement(u.default,{postID:n[0].id})),a.default.createElement("div",{className:"col-md-12"},a.default.createElement(l.Link,{to:"/"},a.default.createElement("button",{className:"btn btn-default"},"Wróć"))))}}]),t}();t.default=i}});