spoti-search/static/js/main.29d93776.chunk.js

2 lines
5.6 KiB
JavaScript
Raw Normal View History

2020-08-17 19:46:07 +00:00
(this["webpackJsonpspoti-search"]=this["webpackJsonpspoti-search"]||[]).push([[0],{115:function(e,t,a){e.exports=a(131)},131:function(e,t,a){"use strict";a.r(t);var n=a(0),r=a.n(n),i=a(33),l=a.n(i),c=a(58),o=a(59),m=a(89),u=a(56),s=a(52),g=a(92),p=a(144),h=a(93),d=a(78),b=a(90),f=a(145),E=a(146),v=a(147),x=function(){return r.a.createElement(f.a,{as:"header",direction:"row",align:"center",justify:"between",background:"brand",pad:{left:"medium",right:"small",vertical:"small"},style:{zIndex:1}},r.a.createElement(E.a,{margin:{vertical:"small"},color:"light-1",size:"xxlarge",weight:"bold"},"Spoti Search"),r.a.createElement(v.a,{href:"https://github.com/ruihildt/spoti-search",label:"Github",color:"white"}))},w=a(142),y=a(143),j=function(e){var t=e.inputValue,a=e.handleChange,n=e.suggestions,i=e.handleSelect;return r.a.createElement(f.a,{as:"section",direction:"row",justify:"center",margin:{top:"large"}},r.a.createElement(f.a,{as:"div",margin:{vertical:"none"},width:"500px"},r.a.createElement(w.a,{type:"search",name:"q",value:t,suggestions:n,onChange:function(e){return a(e.target.value)},onSelect:function(e){return i(e.suggestion)},icon:r.a.createElement(y.a,{color:"plain"}),dropHeight:"large",placeholder:"Type an artist name",autoFocus:!0,"aria-label":"Search by artist name"})))},O=a(148),k=a(49),S=a.n(k),z=function(e){var t=e.image,a=e.name;return t||(t=S.a),r.a.createElement(f.a,{width:"255px",margin:{right:"20px"}},r.a.createElement(f.a,{height:"255px",width:"255px",background:{repeat:"no-repeat",size:"cover",image:"url(".concat(t,")")}}),r.a.createElement(O.a,{level:"4",margin:{bottom:"small",top:"small",left:"small"}},a))},q=function(e){var t=e.image,a=e.name,n=e.handleClick;return t||(t=S.a),r.a.createElement(f.a,{round:"xxsmall",pad:"xsmall",onClick:function(){return n(a)},width:"130px"},r.a.createElement(f.a,{height:"120px",width:"120px",round:"full",background:{repeat:"no-repeat",size:"cover",image:"url(".concat(t,")")}}),r.a.createElement(E.a,{margin:{bottom:"small",top:"small",left:"small"},textAlign:"center",weight:"bold",wordBreak:"break-word"},a))},C=function(e){var t=e.artists,a=e.handleClick,n=t[0],i=n.name,l=n.image,c=n.albums,o=t.slice(1,t.length),m=[],u=l;l||(u=S.a);var s=new Set;return c.forEach((function(e){s.has(e.name)||(s.add(e.name),m.push(e))})),r.a.createElement(r.a.Fragment,null,r.a.createElement(f.a,{width:"xxlarge",margin:{vertical:"0",horizontal:"auto"}},r.a.createElement(O.a,{level:"1",size:"medium"},i)),r.a.createElement(f.a,{as:"section",direction:"row",width:"xxlarge",margin:{vertical:"0",horizontal:"auto"}},r.a.createElement(f.a,{direction:"column",align:"center",width:{min:"320px",max:"320px"},margin:{top:"0",bottom:"0",left:"20px",right:"80px"}},r.a.createElement(f.a,null,r.a.createElement(f.a,{round:"full",background:{repeat:"no-repeat",size:"cover",image:"url(".concat(u,")")},height:"270px",width:"270px",margin:{top:"0",bottom:"15px",left:"0",right:"0"}})),r.a.createElement(f.a,null,r.a.createElement(O.a,{level:"2",size:"small"},"Other results"),r.a.createElement(f.a,{direction:"row-reverse",justify:"around",wrap:!0},o.map((function(e){return r.a.createElement(q,{key:e.id,image:e.image,name:e.name,handleClick:a})}))))),r.a.createElement(f.a,{direction:"column",width:{min:"320px"},margin:{top:"-52px"}},r.a.createElement(O.a,{level:"2",size:"medium"},"Discography"),r.a.createElement(f.a,{direction:"row",justify:"start",wrap:!0},m.map((function(e){return r.a.createElement(z,{key:e.id,image:e.image,name:e.name})}))))))};function A(){var e=Object(g.a)(["\n\tquery Artist($byName: String!) {\n\t\tqueryArtists(byName: $byName) {\n\t\t\tname\n\t\t\timage\n\t\t\tid\n\t\t\talbums {\n\t\t\t\tname\n\t\t\t\timage\n\t\t\t\tid\n\t\t\t}\n\t\t}\n\t}\n"]);return A=function(){return e},e}var N=Object(d.a)(A());function L(){var e=Object(n.useState)(""),t=Object(s.a)(e,2),a=t[0],i=t[1],l=Object(b.a)(N),c=Object(s.a)(l,2),o=c[0],m=c[1],g=m.data,d=m.error,f=Object(n.useState)([]),E=Object(s.a)(f,2),v=E[0],w=E[1],y=Object(n.useState)([]),O=Object(s.a)(y,2),k=O[0],S=O[1],z=Object(n.useState)(!1),q=Object(s.a)(z
//# sourceMappingURL=main.29d93776.chunk.js.map