-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomponent---src-pages-join-waitlist-js-5ffcf92db828dfec44e4.js
2 lines (2 loc) · 9.33 KB
/
component---src-pages-join-waitlist-js-5ffcf92db828dfec44e4.js
1
2
(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{141:function(e,a,n){"use strict";n.r(a);var t=n(7),r=n.n(t),l=n(0),i=n.n(l),o=n(293),s=n.n(o),c=function(e){function a(){for(var a,n=arguments.length,t=new Array(n),r=0;r<n;r++)t[r]=arguments[r];return(a=e.call.apply(e,[this].concat(t))||this).state={email:"",password:"",isLoading:!1},a._handleChange=function(e){var n;return a.setState(((n={})[e.target.id]=e.target.value,n))},a._signUp=function(e){e.preventDefault();var n=a.state,t=n.email,r=n.password,l=a.props.onLogin;a.setState({isLoading:!0}),console.log(window.uk),window.uk.auth.signup({email:t,password:r},function(e){a.setState({isLoading:!1}),l&&l(e)})},a}return r()(a,e),a.prototype.render=function(){var e=this.state,a=e.email,n=e.password;return i.a.createElement("div",{className:"join clearfix"},i.a.createElement("div",{className:"logo clearfix"},i.a.createElement("img",{width:"218",alt:"",src:s.a})),i.a.createElement("form",{className:"join-form",onSubmit:this._signUp},i.a.createElement("label",{htmlFor:"email"},"E-mail"),i.a.createElement("input",{required:!0,type:"email",value:a,onChange:this._handleChange,id:"email",placeholder:"Enter your email"}),i.a.createElement("label",{htmlFor:"password"},"Password"),i.a.createElement("input",{required:!0,value:n,onChange:this._handleChange,type:"password",id:"password",placeholder:"Enter your password"}),i.a.createElement("button",null,"Join the Waitlist")),i.a.createElement("div",{className:"join-tryon-main"},i.a.createElement("span",{className:"join-tryon"},"Try on styles and order on the spot in our CBD office!"),i.a.createElement("br",null),i.a.createElement("a",{className:"join-tryon-whatsapp",href:"https://api.whatsapp.com/send?phone=6581237783",target:"_blank"},"WhatsApp us"),i.a.createElement("span",{className:"join-tryon"}," to book an in-person fitting.")))},a}(l.Component),u=(n(147),n(294)),d=n.n(u),m=n(295),p=n.n(m),h=(n(49),n(152),n(296)),v=n.n(h),b=n(172),f=n.n(b),g=[{label:"Administrator",value:"Administrator"},{label:"Accountant",value:"Accountant"},{label:"Advertising",value:"Advertising"},{label:"Architect",value:"Architect"},{label:"Banker",value:"Banker"},{label:"Beauty Advisor",value:"Beauty Advisor"},{label:"Consultant",value:"Consultant"},{label:"Computing/Software Services",value:"Computing/Software Services"},{label:"Designer",value:"Designer"},{label:"Doctor",value:"Doctor"},{label:"Engineer",value:"Engineer"},{label:"E-Commerce",value:"E-Commerce"},{label:"Entrepreneur / Business Owner",value:"Entrepreneur / Business Owner"},{label:"Fashion & Media",value:"Fashion & Media"},{label:"Insurance Agent",value:"Insurance Agent"},{label:"Journalist / Writer",value:"Journalist / Writer"},{label:"Lawyer",value:"Lawyer"},{label:"Nurse",value:"Nurse"},{label:"Paralegal",value:"Paralegal"},{label:"Professor",value:"Professor"},{label:"Retail",value:"Retail"},{label:"Teacher",value:"Teacher"},{label:"Tourism",value:"Tourism"},{label:"Others",value:"Others"}],E=[{value:"xs",label:"XS",subLabel:"UK 6"},{value:"s",label:"S",subLabel:"UK 8"},{value:"m",label:"M",subLabel:"UK 10"},{value:"l",label:"L",subLabel:"UK 12"}],w=function(e){function a(){for(var a,n=arguments.length,t=new Array(n),r=0;r<n;r++)t[r]=arguments[r];return(a=e.call.apply(e,[this].concat(t))||this).state={size:"s",occupation:"Administrator",phone:"",fName:"",lName:""},a._handleChange=function(e){var n;return a.setState(((n={})[e.target.id]=e.target.value,n))},a._handleSubmit=function(e){e.preventDefault();var n=a.state,t=n.size,r=n.occupation,l=n.phone,i=n.fName,o=n.lName,s=a.props,c=s.token,u=s.onUpdated,d={size:t,occupation:r,phone:l,name:i+" "+o};window.uk.profile.updateProfile(d,function(e){if(e.code){var a='\n mutation{\n guestMutation{\n profileUpdateOne(record:{\n name: "'+d.name+'"\n }) {\n recordId\n record {\n email\n name\n accountId\n distinctId\n profileId\n phoneNumber\n customerId\n subscriptionId\n current_period_end\n current_period_start\n isPaid\n planId\n height\n weight\n bust\n waist\n hip\n recentOrderId\n lastVisit\n updatedAt\n createdAt\n }\n }\n }\n }';f()({method:"post",url:window.apiURL,data:{query:a},headers:{authorization:c}}).then(function(){return u()})}})},a}return r()(a,e),a.prototype.render=function(){var e,a=this,n=this.state.size;return i.a.createElement("div",{className:"user"},i.a.createElement("h1",{className:"headerMessage"},"Last step! Complete this so we can onboard you."),i.a.createElement("form",{onSubmit:this._handleSubmit},i.a.createElement("div",{className:"userFields"},i.a.createElement("label",null,"First name"),i.a.createElement("input",{id:"fName",onChange:this._handleChange,placeholder:"Input your name",required:!0})),i.a.createElement("div",{className:"userFields"},i.a.createElement("label",null,"Surname"),i.a.createElement("input",{id:"lName",onChange:this._handleChange,placeholder:"Input your name",required:!0})),i.a.createElement("div",{className:"clearfix"}),i.a.createElement("div",{className:"user-phone clearfix userFields"},i.a.createElement("label",null,"Phone number"),i.a.createElement("img",{src:v.a,alt:""}),i.a.createElement("span",null,"65+"),i.a.createElement("input",((e={id:"phone",className:"phone",onChange:this._handleChange,placeholder:"Enter your number"}).className="phone-number",e.required=!0,e.type="number",e))),i.a.createElement("label",null,"Occupation"),i.a.createElement("div",{className:"select-style"},i.a.createElement("select",{id:"occupation",onChange:this._handleChange,placeholder:"ABC"},g.map(function(e){return i.a.createElement("option",{key:e.value,value:e.value},e.label)}))),i.a.createElement("label",{style:{marginTop:15,marginBottom:5}},"Your size"),i.a.createElement("div",{className:"sizes"},E.map(function(e){return i.a.createElement("div",{key:e.value,onClick:function(){return a.setState({size:e.value})},className:"size"+(n===e.value?" active":"")},i.a.createElement("div",{className:"size-label"},e.label+" - "+e.subLabel))})),i.a.createElement("div",{style:{width:"100%"}},i.a.createElement("button",{className:"join-now-button"},"Join now"))))},a}(l.Component),y=n(148),N=(n(316),{join:d.a,user:p.a}),C=function(e){function a(){for(var a,n=arguments.length,t=new Array(n),r=0;r<n;r++)t[r]=arguments[r];return(a=e.call.apply(e,[this].concat(t))||this).state={currentPage:"join",error:!1,profileID:"",token:""},a._checkLogin=function(e){if(200===e.code){var n=e.data,t=n.profiles[0],r=t.account_email;if(window.uk.profile.updateProfile({_account_email:r}),t.occupation)a.setState({error:!0});else{var l='\n mutation{\n guestMutation{\n create(record:{email: "'+r+'"}) {\n recordId\n record {\n email\n name\n accountId\n distinctId\n profileId\n phoneNumber\n customerId\n subscriptionId\n current_period_end\n current_period_start\n isPaid\n planId\n height\n weight\n bust\n waist\n hip\n recentOrderId\n lastVisit\n updatedAt\n createdAt\n }\n }\n }\n }\n ';f()({method:"post",url:window.apiURL,data:{query:l},headers:{authorization:n.token}}).then(function(e){a.setState({profileID:t._id,token:n.token,currentPage:"user"})})}}else a.setState({error:!0})},a._handleUpdated=function(){window.location="https://madthread.com/thank-you"},a}return r()(a,e),a.prototype.render=function(){var e=this,a=this.state,n=a.currentPage,t=a.profileID,r=a.token,l=a.error;return i.a.createElement(y.a,null,l&&i.a.createElement("div",{className:"error",onClick:function(){return e.setState({error:!1})}},i.a.createElement("div",{onClick:function(e){return e.stopPropagation()}},i.a.createElement("h1",null,"Woops."),i.a.createElement("div",null,"Email already exists."))),i.a.createElement("div",{className:"loading"}),i.a.createElement("div",{className:"main"},i.a.createElement("div",{className:"main-photo",style:{backgroundImage:"url("+N[n]+")"}}),i.a.createElement("div",{className:"main-content-page"},"join"===n,i.a.createElement("div",{className:"main-content clearfix"},"join"===n&&i.a.createElement(c,{onLogin:this._checkLogin}),"user"===n&&i.a.createElement(w,{profileID:t,token:r,onUpdated:this._handleUpdated})))))},a}(i.a.Component);a.default=C},293:function(e,a,n){e.exports=n.p+"static/logo-f55428ffc72e5460d0a9b2056ea39bd0.png"},294:function(e,a,n){e.exports=n.p+"static/join-29ebeb180662999d5e1e75c765ce9ffd.jpg"},295:function(e,a,n){e.exports=n.p+"static/user-baef887270762d41098ad2e3171748dd.jpg"},296:function(e,a,n){e.exports=n.p+"static/smallFlag-87b02b83047427a4c6486ad1878565d6.svg"},316:function(e,a,n){}}]);
//# sourceMappingURL=component---src-pages-join-waitlist-js-5ffcf92db828dfec44e4.js.map