text: (window.webpackJsonp=window.webpackJsonp||[]).push([[60],{"9Y/7":function(e,t,n){e.exports=n.p+"static/magnum-products-hero-dbb7096c7f052bc269bece3bb5ee11c9.jpg"},D9PK:function(e,t,n){e.exports=n.p+"static/magnum-products-hero-mobile-308fd2c7cf0593e9943d8e67f4285434.jpg"},it24:function(e,t,n){"use strict";n.r(t);var a=n("dI71"),i=n("q1tI"),r=n.n(i),o=n("vOnD"),l=n("9Y/7"),d=n.n(l),c=n("D9PK"),s=n.n(c),u=o.b.img.withConfig({displayName:"products__MagnumHeroImage",componentId:"nnqwsq-0"})(["width:100%;height:550px;object-fit:cover;@media (max-width:1200px){height:400px;content:url(",");}@media (max-width:692px){margin-top:50px;}"],s.a),m=o.b.div.withConfig({displayName:"products__ProductSectionDiv",componentId:"nnqwsq-1"})(["max-width:100%;width:100%;margin-top:50px;margin-bottom:80px;&:after{content:'';display:block;clear:both;}@media (max-width:692px){margin-top:0px;}h1{color:#523022;text-align:center;margin-bottom:50px;font-weight:700;}h2{color:#523022;font-size:1.3rem;}"]),p=o.b.div.withConfig({displayName:"products__FilterDiv",componentId:"nnqwsq-2"})(["width:15%;margin-left:5%;margin-top:100px;float:left;text-align:center;position:sticky;top:120px;left:0;@media (max-width:1100px){width:25%;}@media (max-width:692px){display:none;}"]),g=o.b.div.withConfig({displayName:"products__ProductDiv",componentId:"nnqwsq-3"})(["width:60%;float:left;position:relative;.divider{width:4px;height:calc(100% - 100px);background:linear-gradient(60deg,#edd496 0,#c5923c 40%,#c5923c 60%,#edd496 100%);border-radius:95%;position:absolute;left:0;top:100px;@media (max-width:692px){display:none;}}@media (max-width:1100px){width:55%;margin-top:20px;}@media (max-width:692px){width:100%;margin-top:20px;}"]),h=o.b.button.withConfig({displayName:"products__Filter",componentId:"nnqwsq-4"})(["color:#523022;padding:10px 30px;width:150px;margin:10px 10px;border-radius:10px;background:linear-gradient(60deg,#c5923c 0,#edd496 40%,#edd496 60%,#c5923c 100%);border:none;text-transform:none;transition:.5s;box-shadow:0px -3px 2px rgba(0,0,0,0.39);outline:none;text-decoration:none;&:hover{background:linear-gradient(60deg,#4e2c1d 0,#c5923c 40%,#c5923c 60%,#4e2c1d 100%);transform:scale(1.1);opacity:1;border:none;outline:none;text-decoration:none;}&:focus{outline:none;background:linear-gradient(60deg,#4e2c1d 0,#c5923c 40%,#c5923c 60%,#4e2c1d 100%);color:#523022;font-weight:bold;}&:visited{outline:none;background:linear-gradient(60deg,#4e2c1d 0,#c5923c 40%,#c5923c 60%,#4e2c1d 100%);color:#523022;font-weight:bold;}"]),f=o.b.ul.withConfig({displayName:"products__ProductsUl",componentId:"nnqwsq-5"})(["display:grid;grid-template-columns:repeat(3,1fr);list-style:none;justify-items:center;padding-left:5%;@media (max-width:692px){border-left:none;padding-left:0;}img{margin-left:auto;margin-right:auto;display:block;width:80%;transition:all .2s linear;&:hover{transform:scale(1.1);}}div{margin-left:auto;margin-right:auto;background:linear-gradient(60deg,#c5923c 0,#edd496 40%,#edd496 60%,#c5923c 100%);;color:#523022;border-radius:15px;width:80%;padding:0 10px 10px 10px;margin-bottom:7%;font-weight:bold;text-align:center;height:90%;h3{font-size:1rem;}}@media (max-width:692px){grid-template-columns:repeat(2,1fr);}"]),w=o.b.button.withConfig({displayName:"products__ShowMore",componentId:"nnqwsq-6"})(["color:#523022;padding:10px 30px;width:150px;border:none;display:block;margin-left:auto;margin-right:auto;border-radius:10px;background:linear-gradient(60deg,#c5923c 0,#edd496 40%,#edd496 60%,#c5923c 100%);border:none;text-transform:none;transition:.5s;box-shadow:0px -3px 2px rgba(0,0,0,0.39);outline:none;text-decoration:none;&:hover{background:linear-gradient(60deg,#4e2c1d 0,#c5923c 40%,#c5923c 60%,#4e2c1d 100%);transform:scale(1.15);opacity:1;border:none;outline:none;text-decoration:none;}&:focus{outline:none;}"]),x={allProducts:!0,filterOne:!1,filterTwo:!1,limit:12},b=function(e){function t(){for(var t,n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return(t=e.call.apply(e,[this].concat(a))||this).state=x,t.handleShowAll=function(){t.setState(Object.assign({},x))},t.handleShowFilterOne=function(){t.setState(Object.assign({},x,{filterOne:!0}))},t.handleShowFilterTwo=function(){t.setState(Object.assign({},x,{filterTwo:!0}))},t.ifURL=function(){return"?filter=pulgajaatised"==window.location.search?(t.state.allProducts=!1,t.state.filterOne=!0,t.state.filterTwo=!1,t.state.filterThree=!1):"?filter=perejaatised"==window.location.search?(t.state.allProducts=!1,t.state.filterOne=!1,t.state.filterTwo=!0,t.state.filterThree=!1):(t.state.allProducts=!0,t.state.filterOne=!1,t.state.filterTwo=!1,t.state.filterThree=!1)},t.componentDidMount=function(){t.ifURL()},t}return Object(a.a)(t,e),t.prototype.render=function(){var e=this,t=this.props.data;function n(e){var t=new URL(window.location);t.searchParams.set("filter",e),window.history.pushState({},"",t)}return r.a.createElement(r.a.Fragment,null,r.a.createElement(u,{src:d.a,alt:"Magnum jäätis"}),r.a.createElement(m,null,r.a.createElement(p,null,r.a.createElement("h2",null,"Kategooriad"),r.a.createElement(h,{onClick:function(){var t;(t=new URL(window.location)).searchParams.delete("filter"),window.history.pushState({},"",t),e.handleShowAll()}},"Kogu jäätis"),r.a.createElement(h,{onClick:function(){n("pulgajaatised"),e.handleShowFilterOne()}},"Pulgajäätised"),r.a.createElement(h,{onClick:function(){n("perejaatised"),e.handleShowFilterTwo()}},"Perejäätised")),r.a.createElement(g,null,r.a.createElement("div",{class:"divider"}),this.state.allProducts?r.a.createElement("div",null,r.a.createElement("h1",null,"Kogu jäätis"),r.a.createElement(f,null,t.allProduct.nodes.filter((function(t,n){return n<e.state.limit})).map((function(e){return r.a.createElement("li",{key:e.id},r.a.createElement("a",{href:"/magnum/products/"+e.id},r.a.createElement("div",null,r.a.createElement("img",{src:e.img}),r.a.createElement("h3",null,e.fullName))))}))),t.allProduct.nodes.length>12&&this.state.limit<t.allProduct.nodes.length&&r.a.createElement(w,{background:"none",onClick:function(){return e.setState({limit:e.state.limit+12})}}," Näita rohkem ")):null,r.a.createElement("div",{class:"divider"}),this.state.filterOne?r.a.createElement("div",null,r.a.createElement("h1",null,"Pulgajäätised"),r.a.createElement(f,null,t.allProduct.nodes.filter((function(e){return e.productLine.includes("Pulgajäätised")})).map((function(e){return r.a.createElement("li",{key:e.id},r.a.createElement("div",null,r.a.createElement("img",{src:e.img}),r.a.createElement("h3",null,e.fullName)))})))):null,r.a.createElement("div",{class:"divider"}),this.state.filterTwo?r.a.createElement("div",null,r.a.createElement("h1",{style:{textAlign:"center"}},"Perejäätised"),r.a.createElement(f,null,t.allProduct.nodes.filter((function(e){return e.productLine.includes("Perejäätised")})).map((function(e){return r.a.createElement("li",{key:e.id},r.a.createElement("div",null,r.a.createElement("img",{src:e.img}),r.a.createElement("h3",null,e.fullName)))})))):null)))},t}(r.a.Component);t.default=b}}]);
  //# sourceMappingURL=component---src-pages-magnum-products-js-c09693a535df48b2814c.js.map