3Dshock/client/build/static/js/main.eb0b3235.chunk.js

2 lines
8.4 KiB
JavaScript
Raw Normal View History

2021-03-08 05:53:30 +00:00
(this.webpackJsonpclient=this.webpackJsonpclient||[]).push([[0],{161:function(t,e,n){},163:function(t,e,n){},261:function(t,e,n){"use strict";n.r(e);var r=n(0),a=n(24),c=n.n(a),s=(n(161),n(162),n(163),n(81)),u=n(25),i=n(15),o=n.n(i),l=n(27),p=n(41),j=n(152),b=n(266),f=n(263),h=n(40),d=n(90),O=n(61),x=n.n(O),m=function(){var t=Object(l.a)(o.a.mark((function t(e){var n;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,x.a.post("/api/clients",e);case 2:return n=t.sent,t.abrupt("return",n.data.client_id);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),v=function(){var t=Object(l.a)(o.a.mark((function t(e){var n;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,x.a.get("/api/clients/".concat(e));case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),g=function(){var t=Object(l.a)(o.a.mark((function t(e){var n;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,x.a.post("/api/clients/".concat(e,"/session"));case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),w=function(){var t=Object(l.a)(o.a.mark((function t(e){var n;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,x.a.get("/api/clients/".concat(e,"/session"));case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),k=function(){var t=Object(l.a)(o.a.mark((function t(e){return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,x.a.delete("/api/clients/".concat(e,"/session"));case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),y=function(){var t=Object(l.a)(o.a.mark((function t(e){return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,k(e);case 2:return t.next=4,g(e);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),C=n(8),S=function(){var t=Object(u.f)(),e=Object(r.useState)(null),n=Object(p.a)(e,2),a=n[0],c=n[1],s=Object(r.useState)(""),i=Object(p.a)(s,2),O=i[0],x=i[1],v=Object(r.useState)(""),g=Object(p.a)(v,2),w=g[0],k=g[1],y=Object(r.useState)(""),S=Object(p.a)(y,2),I=S[0],F=S[1],N=function(){var e=Object(l.a)(o.a.mark((function e(n){var r;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.preventDefault(),!(I.length<10)){e.next=5;break}return j.b.error("Check all fields!"),c("Phone number needs to be a length of at least 10"),e.abrupt("return");case 5:return e.next=7,m({name:O,email:w,phone:parseInt(I)});case 7:r=e.sent,t.push("/sessions/".concat(r));case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return Object(C.jsxs)(d.Content,{children:[Object(C.jsx)(b.a,{title:"Dashboard",subTitle:"Enter the name, email and phone number of the subject"}),Object(C.jsx)(f.a,{}),Object(C.jsxs)("form",{onSubmit:N,children:[Object(C.jsxs)("label",{htmlFor:"name",children:["Name:",Object(C.jsx)("input",{minLength:3,value:O,onChange:function(t){return x(t.target.value)},name:"name"})]}),Object(C.jsxs)("label",{htmlFor:"email",children:["Email:",Object(C.jsx)("input",{value:w,onChange:function(t){return k(t.target.value)},type:"email",name:"email"})]}),Object(C.jsxs)("label",{htmlFor:"phone",children:["Phone:",Object(C.jsx)("input",{value:I,onChange:function(t){return F(t.target.value)},type:"tel",name:"phone"})]}),Object(C.jsx)(h.a,{danger:!0,onClick:function(){x(""),k(""),F("")},children:"Reset"}),Object(C.jsx)(h.a,{htmlType:"submit",type:"primary",children:"Start Session"}),a&&Object(C.jsx)("p",{className:"error",children:a})]})]})},I=n(268),F=n(267),N=n(264),P=function(t){var e=t.clientId,n=Object(r.useState)(null),a=Object(p.a)(n,2),c=a[0],s=a[1],u=Object(r.useState)(null),i=Object(p.a)(u,2),j=i[0],f=i[1],h=Object(r.useState)(!0),d=Object(p.a)
//# sourceMappingURL=main.eb0b3235.chunk.js.map