1(this["webpackJsonpteam-work"]=this["webpackJsonpteam-work"]||[]).push([[5],{501:function(e,a,t){},504:function(e,a,t){"use strict";t.r(a),t.d(a,"default",(function(){return D}));var r=t(132),i=t(10),o=t(1),n=t(0),s=(t(501),t(406)),c=t(409),l=t(198),d=t(200),g=t(416),m=t(39),u=t(402),p=t(399),h=t(410),j=t(417),b=t(413),O=t(407),_=t(62),x=t(412),v=t(506),f=t(512),y=t(47),w=t(510),N=t(511),k=t(404),z=t(418),I=t(509),S=t(419),T=t(16),E=t(15),F=t.n(E),L=t(187),P=t(23),A=s.a.Paragraph,C=["https://res.cloudinary.com/oluwatobby/image/upload/v1611523113/patternpad_rsioem.svg","https://res.cloudinary.com/oluwatobby/image/upload/v1611524535/patternpad_1_e9eak8.svg","https://res.cloudinary.com/oluwatobby/image/upload/v1611525049/patternpad_3_dwansm.svg","https://res.cloudinary.com/oluwatobby/image/upload/v1611525049/patternpad_4_brmlq7.svg","https://res.cloudinary.com/oluwatobby/image/upload/v1611525049/patternpad_5_dmip0u.svg","https://res.cloudinary.com/oluwatobby/image/upload/v1611525049/patternpad_6_hngtdk.svg","https://res.cloudinary.com/oluwatobby/image/upload/v1611525049/patternpad_2_b4zbgm.svg","https://res.cloudinary.com/oluwatobby/image/upload/v1611525049/patternpad_1_zlxjbn.svg","https://res.cloudinary.com/oluwatobby/image/upload/v1611524535/patternpad_1_e9eak8.svg","https://res.cloudinary.com/oluwatobby/image/upload/v1611523378/undraw_Selecting_team_re_ndkb_oqt5fh.svg"];function D(e){var a=w.a.Types.StringType,t=w.a.Model({name:a().isRequired("Name is required.").minLength(4,"Name Length should more than 4 characters long").maxLength(35,"Name should not exceed 35 characters"),description:a().isRequired("Description field is required.").maxLength(250,"Description should not exceed 250 characters, please keep it short")}),s=Object(n.useState)({loading:!1,message:""}),E=Object(i.a)(s,2),D=E[0],q=E[1],B=Object(n.useState)({name:"",isPrivate:!0,previewOrgImg:"",orgimgFile:"",description:"",headerImg:""}),R=Object(i.a)(B,2),J=R[0],M=R[1],Y=Object(L.a)(),U=Object(i.a)(Y,1)[0],H=Object(n.useState)(!1),V=Object(i.a)(H,2),W=V[0],G=V[1],K=function(a){F.a.post("/org/create",{name:J.name,orgImg:a,description:J.description,headerImg:J.headerImg,isPrivate:J.isPrivate}).then((function(a){q({loading:!1,message:""}),200===a.status&&c.a.success({title:"upload successful",description:"organization created successfully"}),setTimeout((function(){e.history.push("/organization/".concat(a.data.data.organization[0].id))}),2e3)})).catch((function(a){q({loading:!1,message:""}),-1!==a.message.indexOf("403")?(c.a.error({title:"Authentication Error",description:"You have to login"}),setTimeout((function(){e.history.push("/auth/login")}),2e3)):-1!==a.message.indexOf("Network Error")?c.a.warning({title:"Network Error",description:"Looks Like you are not connected to the internet"}):c.a.warning({title:"Server Error",description:"Something went wrong"})}))},Q=function(){var e=Math.floor(10*Math.random())+1;return C[e]};function X(){return Object(o.jsxs)(o.Fragment,{children:[Object(o.jsxs)("div",{className:"org_dash_name",children:[Object(o.jsx)(P.a,{children:Object(o.jsx)("title",{children:"create organization || Teamily"})}),J.name?Object(o.jsx)(l.a,{placement:"top",trigger:"hover",speaker:Object(o.jsx)(d.a,{children:J.name}),children:Object(o.jsx)("p",{style:{cursor:"pointer"},children:J.name})}):Object(o.jsx)(A,{className:"org_dash_name_loader",rows:1})]}),Object(o.jsxs)("div",{style:{backgroundImage:"url(".concat(J.headerImg,")"),backgroundSize:"100% 100%"},className:"org_dash_panel_details",children:[J.previewOrgImg?Object(o.jsx)(g.a,{className:"org_profile_img org_profile_img_rounded",src:J.previewOrgImg,size:"lg"}):Object(o.jsx)(A,{className:"org_profile_img",rows:0,style:{marginTop:30},graph:"image"}),J.isPrivate?Object(o.jsx)(m.a,{className:"privacy_icon",icon:"lock"}):Object(o.jsx)(m.a,{className:"privacy_icon privacy_globe",icon:"globe2"})]}),Object(o.jsxs)("div",{className:"org_dash_description",children:[Object(o.jsx)("p",{children:"Description"}),J.description?Object(o.jsx)("div",{className:"org_dash_description_text",children:J.description}
1):Object(o.jsx)(A,{className:"org_dash_name_loader",rows:1})]})]})}return Object(n.useEffect)((function(){var a=JSON.parse(window.localStorage.getItem("auth-token"));a?(F.a.defaults.headers.common.Authorization="Bearer ".concat(a),M(Object(r.a)(Object(r.a)({},J),{},{headerImg:Q()}))):(c.a.error({title:"Authentication Error",description:"You have to login"}),setTimeout((function(){e.history.push("/auth/login")}),2e3))}),[]),Object(o.jsxs)(u.a,{className:"create_organization_container",children:[D.loading&&Object(o.jsx)(p.a,{backdrop:!0,content:D.message,vertical:!0}),Object(o.jsx)(h.a,{className:"header",children:Object(o.jsx)(y.a,{className:"org_logo"})}),Object(o.jsxs)(u.a,{children:[U>700?Object(o.jsx)(j.a,{className:"org_sidebar",children:X()}):Object(o.jsxs)(o.Fragment,{children:[Object(o.jsx)(b.a,{className:"mobile_nav_bar",onClick:function(){return G(!0)},icon:Object(o.jsx)(m.a,{icon:"bars"}),children:" Preview Organization Details"}),Object(o.jsxs)(O.a,{size:"xs",placement:"left",show:W,className:"mobile_drawer",onHide:function(){return G(!1)},children:[Object(o.jsx)(O.a.Body,{children:X()}),Object(o.jsx)(O.a.Footer,{children:Object(o.jsx)(_.a,{style:{width:"100%"},onClick:function(){return G(!1)},color:"orange",children:"Close"})})]})]}),Object(o.jsx)(x.a,{className:"create_org_content org_content",children:Object(o.jsxs)(N.a,{onSubmit:function(a){if(a)if(q({loading:!0,message:"Uploading Organization Image ...."}),J.orgimgFile){var t=new FormData;t.append("image",J.orgimgFile),F.a.post("/upload",t,{headers:{"content-type":"multipart/form-data"}}).then((function(e){200===e.status&&(c.a.success({title:"upload successful",description:"organization profile Image has been uploaded"}),K(e.data.data.secure_url))})).catch((function(a){q({loading:!1,message:""}),-1!==a.message.indexOf("403")?(c.a.error({title:"Authentication Error",description:"You have to login"}),setTimeout((function(){e.history.push("/auth/login")}),2e3)):-1!==a.message.indexOf("Network Error")?c.a.warning({title:"Network Error",description:"Looks Like you are not connected to the internet"}):c.a.warning({title:"Server Error",description:"Something went wrong"})}))}else K()},onChange:function(e){return M(Object(r.a)(Object(r.a)({},J),{},{name:e.name,description:e.description}))},model:t,className:"create_org_form",fluid:!0,children:[Object(o.jsxs)(k.a,{children:[Object(o.jsx)(z.a,{className:"create_org_label",children:"What's the name of your Organization?"}),Object(o.jsx)(I.a,{className:"create_org_input",placeholder:"Organization name",name:"name"}),Object(o.jsx)(S.a,{children:"choose a descriptive name"})]}),Object(o.jsxs)(k.a,{style:{marginTop:"130px"},children:[Object(o.jsx)(z.a,{className:"create_org_label",children:"Add more description about your Organization"}),Object(o.jsx)(I.a,{className:"create_org_input",name:"description"})]}),Object(o.jsxs)(k.a,{style:{marginTop:"130px"},children:[Object(o.jsx)(z.a,{className:"create_org_label",children:"Add a profile image for your organization"}),Object(o.jsx)("div",{className:"uploader_container",children:Object(o.jsx)("input",{type:"file",accept:"image/x-png,image/gif,image/jpeg",onChange:function(e){return function(e){if(e.preventDefault(),e.target.files[0]){var a=new FileReader,t=e.target.files[0];a.onloadend=function(){M(Object(r.a)(Object(r.a)({},J),{},{orgimgFile:t,previewOrgImg:a.result}))},a.readAsDataURL(t)}}(e)}})})]}),Object(o.jsxs)(k.a,{style:{marginTop:"130px"},children:[Object(o.jsx)(z.a,{className:"create_org_label",children:"Set Organization Privacy"}),Object(o.jsx)(v.a,{defaultValue:!0,className:"create_org_input",onSelect:function(e){return M(Object(r.a)(Object(r.a)({},J),{},{isPrivate:e}))},name:"privacy",data:[{value:!0,label:"private",groupBy:"privacy"},{value:!1,label:"public",groupBy:"privacy"}],style:{width:"100%"}})]}),Object(o.jsx)(k.a,{style:{marginTop:"130px"},children:Object(o.jsxs)(f.a,{style:{position:"relative"},children:[Object(o.jsx)(_.a,{loading:D.loading,className:"create_org_form_btn",type:"submit",appearance:"primary",children:"Create Organization"}),Object(o.jsx)(T.b,{style:{zIndex:"10"},to:"/user/organization",children:Object(o.jsx)(_.a,{appearance:"ghost",children:"Cancel"})})]})})]})})]})]})}}}]); 2//# sourceMappingURL=5.8f45ed09.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.