node-go/packages/play-node-go/build/static/js/main.164728a0.chunk.js

2 lines
32 KiB
JavaScript
Raw Normal View History

2020-02-08 01:51:09 +00:00
(this["webpackJsonpreact-boilerplate"]=this["webpackJsonpreact-boilerplate"]||[]).push([[0],[,,,,,,,,function(e,a,t){"use strict";var n=t(1),r=t(45),c="production"===t.n(r)()().REACT_APP_ENVIRONMENT?{apiAddress:"https://node-go-api.herokuapp.com/api/v1",endpoint:"https://play-node-go.herokuapp.com",authAddress:"https://node-go-api.herokuapp.com/auth",socketAddress:"https://node-go-api.herokuapp.com"}:{apiAddress:"http://localhost:8000/api/v1",authAddress:"http://localhost:8000/auth",endpoint:"http://localhost:3000",socketAddress:"http://localhost:8000"};a.a=Object(n.a)({},c)},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,a,t){e.exports=t(118)},,,,,function(e,a,t){},,function(e,a,t){},function(e,a,t){},function(e,a,t){},,,,,function(e,a,t){},function(e,a,t){},function(e,a,t){},function(e,a,t){},function(e,a,t){},function(e,a,t){},function(e,a,t){},function(e,a,t){},function(e,a,t){},function(e,a,t){},function(e,a,t){},function(e,a,t){},function(e,a,t){},function(e,a,t){},function(e,a,t){},function(e,a,t){},function(e,a,t){},function(e,a,t){},function(e,a,t){},function(e,a,t){},function(e,a,t){},function(e,a,t){},function(e,a,t){},function(e,a,t){"use strict";t.r(a),t.d(a,"launch",(function(){return s}));var n=t(46),r=t.n(n),c=t(8),s=function(e,a){var t=r()("".concat(c.a.socketAddress,"/").concat(e));return t.on("connected",(function(){a({type:"SOCKET",message:"CONNECTED",body:{nsp:t.nsp}})})),t.on("connect_error",(function(e){a({type:"ERR",message:"SOCKET_ERROR",body:{socketError:e}})})),t.on("error",(function(e){a({type:"ERR",message:"SOCKET_ERROR",body:{socketError:e}})})),t.on("room_connected",(function(e){a({type:"ROOMS",message:"CONNECT_ROOM",body:e})})),t.on("new_user",(function(e){console.log("new_user received"),a({type:"ROOMS",message:"NEW_USER",body:e})})),t.on("game_connected",(function(e){console.log(e),console.log("game_connected received"),a({type:"GAMES",message:"UPDATE_BOARD",body:e})})),t.on("update_board",(function(e){console.log(e),console.log("update_board received"),a({type:"GAMES",message:"UPDATE_BOARD",body:e.board})})),t}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,a){},,,function(e,a,t){},function(e,a,t){"use strict";t.r(a);var n=t(0),r=t.n(n),c=t(42),s=t.n(c),o=(t(53),t(2)),i=t.n(o),l=t(6),m=t(4),u=t(11),p=(t(55),t(56),t(57),function(){return r.a.createElement(r.a.Fragment,null,"Logo")}),d=function(e){return r.a.createElement("div",{className:"NavBar","data-testid":"NavBar"},r.a.createElement(m.b,{to:"/home"},r.a.createElement("div",{className:"NavBar__logo"},r.a.createElement(p,null))),r.a.createElement(m.b,{to:"/home"},r.a.createElement("div",{className:"NavBar__menu-item NavBar__home"},r.a.createElement("p",null,"Find a Game"))),r.a.createElement(m.b,{to:"/news"},r.a.createElement("div",{className:"NavBar__menu-item NavBar__news"},r.a.createElement("p",null,"News"))),r.a.createElement(m.b,{to:"/account"},r.a.createElement("div",{className:"NavBar__menu-item NavBar__acount"},e.user?e.user.username:r.a.createElement(r.a.Fragment,null))))},_=(t(62),function(){return r.a.createElement("nav",null)}),E=t(1),f=(t(63),t(8)),b=f.a.authAddress,h="".concat(b,"/signup"),g="".concat(b,"/login"),v=new Headers;v.append("Content-Type","application/json"),v.append("Accept","application/json"),v.append("Sec-Fetch-Site","cross-site");var y=function(e){var a;return i.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i.a.awrap(fetch(g,{method:"POST",credentials:"include",body:JSON.stringify(e),headers:v}).then((function(e){return e.text()})).then((function(e){return JSON.parse(e)})).catch((function(e){return e})));case 2:return a=t.sent,t.abrupt("return",a);case 4:case"end":return t.stop()}}))},N=function(e){var a;return i.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i.a.awrap(fetch(h,{method:"POST",credentials:"include",body:JSON.stringify(e),headers:v}).then((function(e){return e.text()})).then((function(e){return JSON.parse(e)})).catch((function(e){return e})));case 2:return a=t.sent,t.abrupt("return",a);case 4:case"end":return t.stop()}}))},O=(t(64),function(
//# sourceMappingURL=main.164728a0.chunk.js.map