%PDF- %PDF-
Direktori : /home/opti/public_html/ncf/static/js/ |
Current File : /home/opti/public_html/ncf/static/js/55.3169ad23.chunk.js |
(this["webpackJsonpncf-nigeria"]=this["webpackJsonpncf-nigeria"]||[]).push([[55],{104:function(e,a,s){},206:function(e,a,s){},534:function(e,a,s){"use strict";s.r(a);var t,n,c=s(48),o=s(50),r=s(1),l=(s(206),s(104),s(54)),i=s(21),m=function(e){e.password===e.confirm_password?fetch("".concat(i.SERVER_URL,"/auth/register"),{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)}).then((function(e){return e.json()})).then((function(e){console.log(e,"json"),200===e.status?(localStorage.setItem("login-success",JSON.stringify(e.message)),window.location.reload()):422===e.status?(localStorage.setItem("login-error",JSON.stringify(e.message)),window.location.reload()):console.log("An error occured")})):(localStorage.setItem("login-error","Password Must Match"),window.location.reload())},u=s(103),d=s(49),j=s(519),h=s(516),f=s(520),b=s(470),g=s(2),p=j.a.Option;a.default=function(){var e=localStorage.getItem("login-error"),a=localStorage.getItem("login-success");return setTimeout((function(){localStorage.removeItem("login-error")}),500),setTimeout((function(){localStorage.removeItem("login-success")}),500),Object(g.jsxs)(I,{children:[Object(g.jsx)(l.a,{}),Object(g.jsxs)(O,{children:[e?Object(g.jsx)(u.a,{className:"mt-5",color:"danger",children:e}):null,a?Object(g.jsx)(u.a,{className:"mt-5",color:"success",children:a}):null,Object(g.jsx)(x,{})]})]})};var O=d.a.div(t||(t=Object(o.a)(["\n width: 100%;\n min-height: 100vh;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n background-color: #0000008f;\n"]))),I=d.a.section(n||(n=Object(o.a)(["\n width: 100%;\n min-height: 100vh;\n background: url('assets/images/banner/species.png');\n background-size: cover;\n background-position: center;\n"]))),x=function(){var e=Object(r.useState)([]),a=Object(c.a)(e,2),s=a[0],t=a[1],n=Object(r.useState)([]),o=Object(c.a)(n,2),l=o[0],u=o[1],d=Object(r.useState)([]),O=Object(c.a)(d,2),I=O[0],x=O[1];Object(r.useEffect)((function(){fetch("".concat(i.SERVER_URL,"/location/country")).then((function(e){return e.json()})).then((function(e){console.log(e.message,"json"),200===e.status?t(e.data):console.log("Oops couldn't fetch data")}))}),[]);return Object(g.jsxs)(h.a,{className:"signupform",name:"basic",initialValues:{remember:!0},onFinish:function(e){var a=e.fullname.split(" ",2),s=a[0],t=a[1],n=e.companyName,c=e.country.label,o=e.address,r=e.state.label,l=e.city.label,i=e.phone,u=e.email,d=e.password,j=e.confirmPassword;m({first_name:s,last_name:t,company_name:n,country:c,address:o,state:r,city:l,tel:i,email:u,password:d,confirm_password:j})},onFinishFailed:function(e){console.log("Failed:",e)},autoComplete:"off",children:[Object(g.jsx)("h1",{className:"text-white",children:"SIGN UP"}),Object(g.jsxs)("div",{className:"form-item-group",children:[Object(g.jsx)(h.a.Item,{className:"formItemcon",name:"fullname",rules:[{required:!0,message:"Please enter your full name"}],children:Object(g.jsx)(f.a,{placeholder:"Full Name",className:"formItem"})}),Object(g.jsx)(h.a.Item,{className:"formItemcon",name:"companyName",rules:[{required:!1}],children:Object(g.jsx)(f.a,{placeholder:"Company Name(optional)",className:"formItem"})})]}),Object(g.jsxs)("div",{className:"form-item-group group",children:[Object(g.jsx)(h.a.Item,{className:"formItemcon",name:"address",rules:[{required:!0,message:"Address"}],children:Object(g.jsx)(f.a,{placeholder:"Address",className:"formItem"})}),Object(g.jsx)(h.a.Item,{className:"formItemcon",name:"country",rules:[{required:!0,message:"Country"}],children:Object(g.jsx)(j.a,{placeholder:"Country",className:"formItem",labelInValue:!0,onChange:function(e){var a=e.key;fetch("".concat(i.SERVER_URL,"/location/state/").concat(a)).then((function(e){return e.json()})).then((function(e){console.log(e.message,"json"),200===e.status?u(e.data):console.log("Oops couldn't fetch data")}))},children:s.map((function(e){return Object(g.jsx)(p,{value:e.id,children:e.name},e.id)}))})})]}),Object(g.jsxs)("div",{className:"form-item-group",children:[Object(g.jsx)(h.a.Item,{className:"formItemcon",name:"state",rules:[{required:!0,message:"Input your state"}],children:Object(g.jsx)(j.a,{placeholder:"State",className:"formItem",labelInValue:!0,onChange:function(e){var a=e.key;fetch("".concat(i.SERVER_URL,"/location/city/").concat(a)).then((function(e){return e.json()})).then((function(e){console.log(e.message,"json"),200===e.status?x(e.data):console.log("Oops couldn't fetch data")}))},children:l.map((function(e){return Object(g.jsx)(p,{value:e.id,children:e.name},e.id)}))})}),Object(g.jsx)(h.a.Item,{className:"formItemcon",name:"city",rules:[{required:!0,message:"Please input your city"}],children:Object(g.jsx)(j.a,{placeholder:"City",className:"formItem",labelInValue:!0,children:I.map((function(e){return Object(g.jsx)(p,{value:e.id,children:e.name},e.id)}))})})]}),Object(g.jsxs)("div",{className:"form-item-group",children:[Object(g.jsx)(h.a.Item,{className:"formItemcon",name:"phone",rules:[{required:!0,message:"Input your phone number"}],children:Object(g.jsx)(f.a,{placeholder:"Phone",className:"formItem"})}),Object(g.jsx)(h.a.Item,{className:"formItemcon",name:"email",rules:[{required:!0,type:"email",message:"Please input a valid email address"}],children:Object(g.jsx)(f.a,{placeholder:"Email",className:"formItem"})})]}),Object(g.jsxs)("div",{className:"form-item-group",children:[Object(g.jsx)(h.a.Item,{className:"formItemcon",name:"password",rules:[{required:!0,message:"Enter your password"}],children:Object(g.jsx)(f.a.Password,{placeholder:"Password",className:"formItem"})}),Object(g.jsx)(h.a.Item,{className:"formItemcon",name:"confirmPassword",rules:[{required:!0,message:"Enter your password again"}],children:Object(g.jsx)(f.a.Password,{placeholder:"Confirm Password",className:"formItem"})})]}),Object(g.jsx)(h.a.Item,{children:Object(g.jsx)(b.a,{className:"formButton",type:"primary",htmlType:"submit",children:"Create Account"})}),Object(g.jsx)(h.a.Item,{className:"signinlink",children:Object(g.jsxs)("h5",{children:["Already Have an Account ",Object(g.jsx)("a",{href:"/signin",children:"Sign In"})]})})]})}}}]); //# sourceMappingURL=55.3169ad23.chunk.js.map