{"size": 2691, "ext": "js", "max_stars_repo_path": "static/js/main.c61dd103.chunk.js", "max_stars_repo_name": "mdjacksparrow/React-Image_finder", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "static/js/main.c61dd103.chunk.js", "max_issues_repo_name": "mdjacksparrow/React-Image_finder", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "static/js/main.c61dd103.chunk.js", "max_forks_repo_name": "mdjacksparrow/React-Image_finder", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 1345.5, "max_line_length": 2643, "alphanum_fraction": 0.6837606838}
(this["webpackJsonpimage-gallery"]=this["webpackJsonpimage-gallery"]||[]).push([[0],{70:function(e,a,t){e.exports=t(97)},96:function(e,a,t){},97:function(e,a,t){"use strict";t.r(a);var n=t(0),c=t.n(n),l=t(8),r=t.n(l),m=t(130),u=t(136),i=t(134),o=t(135),s=t(59),g=t.n(s),E=function(){return c.a.createElement("div",null,c.a.createElement(m.a,{position:"static"},c.a.createElement(i.a,null,c.a.createElement(o.a,{edge:"start",color:"inherit","aria-label":"menu"},c.a.createElement(g.a,null)),c.a.createElement(u.a,{variant:"h5"},"Image Finder"))))},h=t(31),p=t(29),b=t(40),f=t(141),v=t(143),d=t(140),O=t(144),j=t(60),x=t.n(j),y=t(61),T=t.n(y),k=t(139),C=function(){var e=Object(n.useState)(!1),a=Object(b.a)(e,2),t=a[0],l=a[1],r=Object(n.useState)({searchText:"",amount:5,apiUrl:"https://pixabay.com/api",apiKey:"16209559-d8a3895a46194b6395ededbf8",images:[]}),m=Object(b.a)(r,2),u=m[0],i=m[1];return c.a.createElement("div",null,c.a.createElement("div",{className:"searchBox"},c.a.createElement(f.a,{className:"text-field",name:"searchText",onChange:function(e){0===u.searchText.length&&i(Object(p.a)({},u,{images:[]})),i(Object(p.a)({},u,Object(h.a)({},e.target.name,e.target.value)))},value:u.searchText,label:"Image Name"}),c.a.createElement("div",null,c.a.createElement(v.a,null,"Count"),c.a.createElement(d.a,{name:"amount",open:t,onClose:function(){return l(!1)},onOpen:function(){return l(!0)},value:u.amount,onChange:function(e){var a=e.target,t=a.name,n=a.value;i((function(e){return Object(p.a)({},e,Object(h.a)({},t,n))}))}},c.a.createElement(O.a,{value:0},c.a.createElement("em",null,"0")),c.a.createElement(O.a,{value:5},"5"),c.a.createElement(O.a,{value:10},"10"),c.a.createElement(O.a,{value:15},"15"),c.a.createElement(O.a,{value:20},"20"))),c.a.createElement(o.a,{className:"search-btn",onClick:function(){console.log(u.images),u.searchText.length>0&&u.amount>0?x.a.get("".concat(u.apiUrl,"?key=").concat(u.apiKey,"&q=").concat(u.searchText,"&image_type=photo&safesearch=true&per_page=").concat(u.amount)).then((function(e){return i(Object(p.a)({},u,{images:e.data.hits}))})).catch((function(e){return console.log(e)})):i(Object(p.a)({},u,{images:[]}))}},c.a.createElement(T.a,null))),c.a.createElement(k.a,{container:!0,spacing:3},u.images.map((function(e){return c.a.createElement(k.a,{item:!0,xs:12,sm:4,key:e.id},c.a.createElement("img",{src:e.largeImageURL,alt:"finding images"}))}))))};t(96);var I=function(){return c.a.createElement(c.a.Fragment,null,c.a.createElement(E,null),c.a.createElement("div",null,c.a.createElement(C,null)))};r.a.render(c.a.createElement(I,null),document.getElementById("root"))}},[[70,1,2]]]);
//# sourceMappingURL=main.c61dd103.chunk.js.map