text: (this.webpackJsonpstory=this.webpackJsonpstory||[]).push([[0],{105:function(e,t,c){},107:function(e,t,c){},108:function(e,t,c){},109:function(e,t,c){},110:function(e,t,c){},113:function(e,t,c){},114:function(e,t,c){},115:function(e,t,c){},116:function(e,t,c){},117:function(e,t,c){},118:function(e,t,c){},119:function(e,t,c){"use strict";c.r(t);var s=c(0),r=c.n(s),a=c(10),j=c.n(a),n=c(24),b=c(12),i=c(153),o=(c(82),c(1)),l=function(){return Object(o.jsxs)("div",{className:"notfound-container",children:[Object(o.jsx)("h1",{className:"errorcode",children:"404"}),Object(o.jsx)("h2",{children:"Oops an Error have occured"}),Object(o.jsx)("p",{children:"This page is unavailable or does not exist"}),Object(o.jsx)("br",{}),Object(o.jsx)(i.a,{href:"/",variant:"contained",color:"primary",children:"Return to Home"}),Object(o.jsx)("br",{}),Object(o.jsx)("br",{}),Object(o.jsx)("br",{})]})},O=c(7),d=c(16),x=c.n(d),u=(c(105),c(38)),h=c.n(u),m=c(152);function p(){var e=r.a.useState(""),t=Object(O.a)(e,2),c=t[0],s=t[1],a=r.a.useState(""),j=Object(O.a)(a,2),n=j[0],b=j[1],l=r.a.useState(""),d=Object(O.a)(l,2),u=d[0],p=d[1];return Object(o.jsxs)("div",{className:"Feed-component",children:[Object(o.jsx)("br",{}),Object(o.jsx)("br",{}),Object(o.jsx)("h1",{children:"Let us a feedback"}),Object(o.jsx)("br",{}),Object(o.jsxs)("div",{className:"field",children:[Object(o.jsx)("label",{htmlFor:"username",children:"Username : "}),Object(o.jsx)("br",{}),Object(o.jsx)("br",{}),Object(o.jsx)(m.a,{id:"standard-basic",label:"Username",type:"text",onChange:function(e){return b(e.target.value)},placeholder:"Username",required:!0}),Object(o.jsx)("br",{}),Object(o.jsx)("br",{}),Object(o.jsx)("label",{htmlFor:"feed",children:"Feedback : "}),Object(o.jsx)("br",{}),Object(o.jsx)("br",{}),Object(o.jsx)("textarea",{required:!0,placeholder:"Feedback",onChange:function(e){return p(e.target.value)}}),Object(o.jsx)("br",{}),Object(o.jsx)("br",{}),Object(o.jsx)(i.a,{variant:"contained",color:"primary",onClick:function(){x.a.post("https://storiez-server.herokuapp.com/feed",{username:n,feed:u}).then((function(e){e.data.err?s("An error have occured : ".concat(e.data.err)):s("".concat(e.data.statue))}))},children:"Submit"}),Object(o.jsx)("br",{}),Object(o.jsx)("br",{}),Object(o.jsx)("br",{}),Object(o.jsxs)("div",{className:"Statue",children:[Object(o.jsx)(h.a,{}),Object(o.jsxs)("p",{children:[" ",c]})]})]}),Object(o.jsx)("br",{}),Object(o.jsx)("br",{})]})}c(107);function v(){return Object(o.jsxs)("div",{children:[Object(o.jsx)(p,{}),Object(o.jsx)("div",{className:"copyright",children:Object(o.jsx)("p",{children:"@Copyright And All Right Reserved MH15O"})})]})}c(108);function f(){var e=r.a.useState(""),t=Object(O.a)(e,2),c=t[0],s=t[1],a=r.a.useState(""),j=Object(O.a)(a,2),n=j[0],b=j[1],l=r.a.useState(""),d=Object(O.a)(l,2),u=d[0],p=d[1],v=r.a.useState(""),f=Object(O.a)(v,2),y=f[0],S=f[1],N=r.a.useState(""),g=Object(O.a)(N,2),k=g[0],F=g[1],z=r.a.useState(k),C=Object(O.a)(z,2),E=(C[0],C[1],r.a.useState("")),T=Object(O.a)(E,2),U=T[0],q=T[1];return Object(o.jsxs)("div",{className:"Feeds-component",children:[Object(o.jsx)("br",{}),Object(o.jsx)("br",{}),Object(o.jsx)("h1",{children:"Write your own Story : "}),Object(o.jsx)("br",{}),Object(o.jsx)("label",{htmlFor:"username",children:"Username : "}),Object(o.jsx)("br",{}),Object(o.jsx)("br",{}),Object(o.jsx)(m.a,{id:"standard-basic",label:"Username",type:"text",onChange:function(e){return b(e.target.value.toLowerCase())},placeholder:"Username",required:!0}),Object(o.jsx)("br",{}),Object(o.jsx)("br",{}),Object(o.jsx)("label",{htmlFor:"username",children:"Email :  "}),Object(o.jsx)("br",{}),Object(o.jsx)("br",{}),Object(o.jsx)(m.a,{id:"standard-basic",label:"Email",type:"text",onChange:function(e){return p(e.target.value)},placeholder:"Email",required:!0}),Object(o.jsx)("br",{}),Object(o.jsx)("br",{}),Object(o.jsx)("label",{htmlFor:"username",children:"Story Title :   "}),Object(o.jsx)("br",{}),Object(o.jsx)("br",{}),Object(o.jsx)(m.a,{id:"standard-basic",label:"Title",type:"text",onChange:function(e){F(e.target.value),q(function(e){return e.toString().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g,"-").toLowerCase().replace(/&/g,"-and-").replace(/[^a-z0-9\-]/g,"").replace(/-+/g,"-").replace(/^-*/,"").replace(/-*$/,"")}(e.target.value))},placeholder:"Title....",required:!0}),Object(o.jsx)("br",{}),Object(o.jsx)("br",{}),Object(o.jsx)("label",{htmlFor:"feed",children:"Story : "}),Object(o.jsx)("br",{}),Object(o.jsx)("br",{}),Object(o.jsx)("textarea",{required:!0,placeholder:"Story",onChange:function(e){return S(e.target.value)}}),Object(o.jsx)("br",{}),Object(o.jsx)("br",{}),Object(o.jsx)(i.a,{variant:"contained",color:"primary",onClick:function(){console.log(U),x.a.post("https://storiez-server.herokuapp.com/addStory",{username:n,email:u,title:k,link:U,story:y}).then((function(e){e.data.err?s(e.data.err):s(e.data.message)}))},children:"Submit"}),Object(o.jsx)("br",{}),Object(o.jsx)("br",{}),Object(o.jsx)("br",{}),Object(o.jsxs)("div",{className:"Statue",children:[Object(o.jsx)(h.a,{}),Object(o.jsxs)("p",{children:[" ",c]})]}),Object(o.jsx)("br",{}),Object(o.jsx)("br",{})]})}c(109),c(110);var y=c(50),S=c.n(y),N=function(e){var t=e.story,c="/".concat(t.username,"/").concat(t.link);return console.log(c),Object(o.jsxs)("div",{className:"story-component",children:[Object(o.jsx)("h1",{children:t.title}),Object(o.jsxs)("div",{className:"vote-div",children:[Object(o.jsx)(S.a,{className:"vote"}),Object(o.jsxs)("p",{children:["Total Votes : ",t.votes]})]}),Object(o.jsx)(n.b,{to:c,children:Object(o.jsx)(i.a,{className:"btn",href:c,variant:"contained",color:"primary",children:"See The Story"})})]})},g=function(e){var t=e.match,c=r.a.useState(""),a=Object(O.a)(c,2),j=(a[0],a[1]),n=r.a.useState(),b=Object(O.a)(n,2),i=b[0],d=b[1];return Object(s.useEffect)((function(){var e=t.params.username;x.a.post("https://storiez-server.herokuapp.com/user/"+e,{}).then((function(e){e.data.statue&&j(e.data.statue),e.data.message&&d(e.data.message)}))}),[]),void 0!==i?Object(o.jsxs)("div",{children:[Object(o.jsx)("h1",{className:"username",children:t.params.username}),Object(o.jsx)("ul",{children:i.map((function(e,t){return Object(o.jsx)("div",{children:Object(o.jsx)("li",{children:Object(o.jsx)(N,{story:e})})})}))})]}):Object(o.jsx)("div",{children:Object(o.jsx)(l,{})})},k=(c(113),c(114),function(e){var t=e.story,c="/".concat(t.username,"/").concat(t.link);console.log(c);var s="/user/".concat(t.username);return Object(o.jsxs)("div",{className:"story-component",children:[Object(o.jsxs)("h1",{className:"user",children:[Object(o.jsxs)(n.b,{className:"link",to:s,children:[t.username," "]})," : ",t.title]}),Object(o.jsx)("br",{}),Object(o.jsx)("br",{}),Object(o.jsx)("br",{}),Object(o.jsx)("br",{}),Object(o.jsx)(n.b,{to:c,children:Object(o.jsx)(i.a,{className:"btn",href:c,variant:"contained",color:"primary",children:"See The Story"})}),Object(o.jsxs)("div",{className:"vote-div",children:[Object(o.jsx)(S.a,{className:"vote"}),Object(o.jsxs)("p",{children:["Total Votes : ",t.votes," votes"]})]})]})}),F=(c(115),function(){var e=Object(s.useState)(""),t=Object(O.a)(e,2),c=t[0],r=t[1],a=Object(s.useState)([]),j=Object(O.a)(a,2),n=j[0],b=j[1];return Object(s.useEffect)((function(){x.a.post("https://storiez-server.herokuapp.com/last-stories",{}).then((function(e){e.data.statue?r(e.data.statue):b(e.data.message)}))}),[]),n.length>0?Object(o.jsx)("div",{className:"elementMapped",children:n.map((function(e){return Object(o.jsx)(k,{story:e})}))}):Object(o.jsx)("div",{children:Object(o.jsxs)("p",{children:["An Error Have Occured ",c]})})});function z(){var e=r.a.useState(""),t=Object(O.a)(e,2),c=t[0],s=(t[1],r.a.useState("")),a=Object(O.a)(s,2),j=a[0],b=a[1],l=r.a.useState(""),d=Object(O.a)(l,2),x=(d[0],d[1],"/user/"+j);return Object(o.jsxs)("div",{className:"Feeds-component",children:[Object(o.jsx)("br",{}),Object(o.jsx)("br",{}),Object(o.jsx)("h1",{children:"Search Your Story"}),Object(o.jsx)("br",{}),Object(o.jsx)("label",{htmlFor:"username",children:"Username Search : "}),Object(o.jsx)("br",{}),Object(o.jsx)("br",{}),Object(o.jsx)(m.a,{id:"standard-basic",label:"Username",type:"text",onChange:function(e){return b(e.target.value)},placeholder:"Username",required:!0}),Object(o.jsx)("br",{}),Object(o.jsx)("br",{}),Object(o.jsx)(n.b,{to:x,children:Object(o.jsx)(i.a,{variant:"contained",color:"primary",children:"Submit"})}),Object(o.jsx)("br",{}),Object(o.jsx)("br",{}),Object(o.jsx)("br",{}),Object(o.jsx)("div",{className:"Statue",children:Object(o.jsxs)("p",{children:[" ",c]})}),Object(o.jsx)("br",{}),Object(o.jsx)("br",{})]})}var C=function(){return Object(o.jsxs)("div",{children:[Object(o.jsx)(z,{}),Object(o.jsx)("h1",{className:"title",children:"Top 5 Last Stories :"}),Object(o.jsx)("br",{}),Object(o.jsx)(F,{})]})},E=(c(116),c(56)),T=c.n(E),U=function(e){var t=e.storyData,c=("https://storiez-server.herokuapp.com/vote/".concat(t.username,"/").concat(t.title),Object(s.useState)(t.votes)),r=Object(O.a)(c,2),a=r[0],j=r[1],n=Object(s.useState)(""),b=Object(O.a)(n,2);b[0],b[1];return void 0!==t.title?void 0!==a?Object(o.jsx)("div",{className:"stsory",children:Object(o.jsxs)("article",{children:[Object(o.jsx)("h1",{className:"titles",children:t.title}),Object(o.jsx)("br",{}),Object(o.jsx)("p",{className:"story",children:t.story}),Object(o.jsx)("br",{}),Object(o.jsxs)("h4",{className:"Author",children:["Written by ",t.username]}),Object(o.jsxs)("p",{className:"totalVotes",children:[Object(o.jsx)(T.a,{})," ",a+1]})]})}):Object(o.jsxs)("div",{className:"stsory",children:[j(t.votes),Object(o.jsxs)("article",{children:[Object(o.jsx)("h1",{className:"titles",children:t.title}),Object(o.jsx)("br",{}),Object(o.jsx)("p",{className:"story",children:t.story}),Object(o.jsx)("br",{}),Object(o.jsxs)("h4",{className:"Author",children:["Written by ",t.username]}),Object(o.jsxs)("p",{className:"totalVotes",children:[Object(o.jsx)(T.a,{})," ",a]})]})]}):Object(o.jsx)("div",{children:Object(o.jsx)(l,{})})},q=function(e){var t=e.match,c=t.params.username,r=t.params.title,a=Object(s.useState)("Succesfully Found"),j=Object(O.a)(a,2),n=(j[0],j[1]),b=Object(s.useState)({}),i=Object(O.a)(b,2),l=i[0],d=i[1],u="https://storiez-server.herokuapp.com/story/".concat(c,"/").concat(r);return Object(s.useEffect)((function(){x.a.post(u,{}).then((function(e){e.data.statue?n(e.data.statue):d({username:e.data[0].username,title:e.data[0].title,votes:e.data[0].votes,story:e.data[0].story})}))}),[]),Object(o.jsx)("div",{children:Object(o.jsx)(U,{storyData:l})})},A=(c(117),function(){var e=r.a.useState(""),t=Object(O.a)(e,2),c=t[0],a=t[1],j=r.a.useState([]),n=Object(O.a)(j,2),b=n[0],i=n[1];return Object(s.useEffect)((function(){x.a.post("https://storiez-server.herokuapp.com/all-stories",{}).then((function(e){e.data.statue?a(e.data.statue):i(e.data.message)}))}),[]),void 0!==b?Object(o.jsx)("div",{className:"mappe",children:Object(o.jsx)("ul",{children:b.map((function(e,t){return Object(o.jsx)("div",{children:Object(o.jsx)("li",{children:Object(o.jsx)(k,{story:e})})})}))})}):Object(o.jsx)("div",{children:Object(o.jsxs)("p",{children:["Opps An error have occured : ",c]})})}),w=(c(118),c(71)),H=c.n(w),W=function(){return Object(o.jsxs)("div",{children:[Object(o.jsx)("header",{children:Object(o.jsxs)("nav",{children:[Object(o.jsxs)("label",{className:"logo",children:[Object(o.jsx)(H.a,{})," Storiez"]}),Object(o.jsxs)("ul",{className:"pasi",children:[Object(o.jsx)("li",{children:Object(o.jsx)("a",{className:"active",href:"/",children:"Home"})}),Object(o.jsx)("li",{children:Object(o.jsx)("a",{href:"/all-stories",children:"Stories"})}),Object(o.jsx)("li",{children:Object(o.jsx)("a",{href:"/add-story",children:"Write Your Story"})})]})]})}),Object(o.jsxs)("div",{className:"phone",children:[Object(o.jsx)("h1",{children:"Menue"}),Object(o.jsx)(i.a,{variant:"contained",color:"primary",href:"/",children:"Home"}),Object(o.jsx)(i.a,{variant:"contained",color:"primary",href:"/all-stories",children:"Storiez"}),Object(o.jsx)(i.a,{variant:"contained",color:"primary",href:"/add-story",children:"Write Your Storiez"})]})]})};var L=function(){return Object(o.jsxs)("div",{children:[Object(o.jsx)(W,{}),Object(o.jsx)(n.a,{children:Object(o.jsxs)(b.c,{children:[Object(o.jsx)(b.a,{exact:!0,path:"/",component:C}),Object(o.jsx)(b.a,{exact:!0,path:"/add-story",component:f}),Object(o.jsx)(b.a,{exact:!0,path:"/all-stories",component:A}),Object(o.jsx)(b.a,{exact:!0,path:"/user/:username",component:g}),Object(o.jsx)(b.a,{exact:!0,path:"/:username/:title",component:q}),Object(o.jsx)(b.a,{path:"*",component:l})]})}),Object(o.jsx)(v,{})]})};function M(){return Object(o.jsx)("div",{children:Object(o.jsx)(L,{})})}j.a.render(Object(o.jsx)(r.a.StrictMode,{children:Object(o.jsx)(M,{})}),document.getElementById("root"))},82:function(e,t,c){}},[[119,1,2]]]);
  //# sourceMappingURL=main.783211fd.chunk.js.map