(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[628],{8040:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/2019",function(){return r(3709)}])},3583:function(e,t){"use strict";t.Z={src:"/_next/static/media/hnfulllogo.531e15fc.png",height:100,width:619,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAABCAMAAADU3h9xAAAAD1BMVEUREREJCQkQEBBGRkaYmJiJbnBwAAAABXRSTlMyPEZE0MWmA+kAAAAJcEhZcwAACxMAAAsTAQCanBgAAAARSURBVAiZY2BhZmRgZGBiAAAATAAMtwDS4wAAAABJRU5ErkJggg=="}},3709:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return O}});var n=r(6042),s=r(9396),a=r(828),i=r(9815),o=r(5893),c=r(7294),l=r(6677),d=r(455),m=r(2857),u=r(1042),x=r(7935),g=r(5675),h=r.n(g),f={src:"/_next/static/media/2019FullLogo.819c47e4.png",height:864,width:6173,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAABCAMAAADU3h9xAAAAD1BMVEWGoId+oX9+un58mHyCnYIQIIBiAAAABXRSTlN2V3NtifCj3KIAAAAJcEhZcwAAFiUAABYlAUlSJPAAAAARSURBVAiZY2BiZGBkYWBgBgAAOAAMB2qEvQAAAABJRU5ErkJggg=="},p=r(3583),A=function(e){var t=e.isVotingOpen,r=(0,c.useState)(0),n=r[0],s=r[1],a=(0,c.useState)(0),i=a[0],l=a[1],d=(0,c.useState)(0),m=d[0],u=d[1],x=(0,c.useState)(0),g=x[0],h=x[1],f=(0,c.useState)(new Date("01/26/2022 23:59:59")),p=f[0],A=(f[1],(0,c.useState)(!1)),v=(A[0],A[1]),b=(0,c.useState)(!1),w=b[0],j=(b[1],(0,c.useState)(!0)),y=j[0];j[1];(0,c.useEffect)((function(){var e=new Date;p.getTime()-e.getTime()<0?v(!0):N()}),[t]);var N=function(){var e=setInterval((function(){var e=new Date,t=p.getTime()-e.getTime(),r=Math.floor(t/864e5);s(r);var n=Math.floor(t%864e5/36e5);l(n);var a=Math.floor(t%36e5/6e4);u(a);var i=Math.floor(t%6e4/1e3);h(i)}),1e3);return function(){return clearInterval(e)}};return(0,o.jsxs)(o.Fragment,{children:[t&&(0,o.jsxs)("div",{className:" w-[320px] sm:w-[275px] lg:w-[320px] flex flex-col justify-center text-center sm:mr-0 mx-auto sm:ml-auto font-display mt-4 text-lg",children:[(0,o.jsxs)("p",{className:" dark:text-green-700 text-green-800 sm:text-right text-center mb-2",children:["Voting ends in"," "]}),(0,o.jsxs)("div",{className:"flex justify-center bg-transparent dark:bg-green-800 text-green-700 dark:text-green-600",children:[(0,o.jsxs)("p",{className:"p-1 border-2 border-green-700 dark:border-green-700 border-r-0 w-[5rem]",children:[n," ",(0,o.jsx)("span",{className:"text-sm",children:"D"})]}),(0,o.jsxs)("p",{className:"p-1 border-2 border-green-700 dark:border-green-700 border-r-0 w-[5rem]",children:[i,(0,o.jsx)("span",{className:"text-sm",children:"H"})]}),(0,o.jsxs)("p",{className:"p-1 border-2 border-green-700 dark:border-green-700 border-r-0 w-[5rem]",children:[m," ",(0,o.jsx)("span",{className:"text-sm",children:"M"})]}),(0,o.jsxs)("p",{className:"p-1 border-2 border-green-700 dark:border-green-700 w-[5rem]",children:[g," ",(0,o.jsx)("span",{className:"text-sm",children:"s"})]})]})]}),y&&(0,o.jsx)("div",{className:"bg-gradient-to-l from-transparent via-white dark:text-black to-transparent h-30",children:(0,o.jsxs)("p",{className:"p-3 text-sm xl:text-xl text-center font-display",children:["Congratulations ",(0,o.jsx)("br",{})," 2019 ",(0,o.jsx)("br",{})," award Winners!"]})}),w&&(0,o.jsxs)("div",{className:" w-full sm:w-[275px] md:w-[200px] lg:w-[300px] xl:w-[450px] flex flex-col justify-center text-center sm:mr-0 mx-auto sm:ml-auto font-display mt-4 text-lg",children:[(0,o.jsxs)("p",{className:" dark:text-green-700 text-green-800 sm:text-right text-center mb-2",children:["Thank you for voting!"," "]}),(0,o.jsx)("div",{className:"flex justify-center bg-transparent dark:bg-green-800 text-green-700 dark:text-gray-200",children:(0,o.jsx)("p",{className:"p-1 border-2 border-green-700 dark:border-gray-200 w-[30rem]",children:(0,o.jsx)("span",{className:"text-sm",children:"The voting Period has Ended. Results will be announced on february 14th!"})})})]})]})},v=(r(5657),r(1163)),b=function(e){e.count;var t=e.isVotingOpen,r=(0,c.useState)([]),n=(r[0],r[1]),s=(0,a.Z)((0,l.Kx)(u.Z.firestore().collection("noonies-ads"),{snapshotListenOptions:{includeMetadataChanges:!0}}),3),i=s[0],d=s[1],x=s[2];(0,v.useRouter)().pathname;(0,c.useEffect)((function(){if(x)throw new Error(x.message);if(!d&&!(null===i||void 0===i?void 0:i.empty)){var e=null===i||void 0===i?void 0:i.docs.map((function(e){return e.data()}));e&&n(e)}}),[i,d,x]);return(0,o.jsx)("div",{className:"bg-[#02ff00] pt-5 md:p-5",children:(0,o.jsx)(m.Z,{children:(0,o.jsx)("div",{className:"flex flex-col",children:(0,o.jsxs)("div",{className:"mb-auto sm:mb-0 pt-1 flex flex-col justify-center sm:flex-row sm:justify-between content-between",children:[(0,o.jsx)("div",{className:"flex flex-col justify-center w-[500px]",children:(0,o.jsx)(h(),{src:f,alt:"Noonies logo",layout:"responsive"})}),(0,o.jsxs)("div",{className:"sm:max-w-[50%] sm:ml-3 flex flex-col justify-center ",children:[(0,o.jsx)("p",{className:"font-semibold mb-4 text-center sm:text-right sm:text-lg text-gray-800",children:"Presented By"}),(0,o.jsx)("div",{className:"w-[20rem] bg-gradient-to-r from-transparent sm:from-[lightgreen] via-green-[lightgreen] rounded-2xl to-transparent p-2 sm:w-[15rem] xl:w-[20rem] mx-[auto] sm:mr-0 sm:ml-[auto]",children:(0,o.jsx)(h(),{src:p.Z,alt:"hnLogo",layout:"responsive"})}),(0,o.jsx)("div",{className:"mt-7 sm:ml-[auto]",children:(0,o.jsx)(A,{isVotingOpen:t})})]})]})})})})},w=r(2898),j=r(3447),y=r(8390),N=r(3253),k=r.n(N),Z=r(6261),B=r(6731);function E(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter(Boolean).join(" ")}var S=function(e){var t=e.isHome,r=(0,c.useState)(!1),n=r[0],s=r[1],i=(0,a.Z)((0,l.d4)(u.Z.firestore().collection("noonies-categories"),{snapshotListenOptions:{includeMetadataChanges:!0}}),3),d=i[0],m=i[1];i[2];return m?null:(0,o.jsxs)("div",{className:"flex sticky p-1 pt-0 top-[4rem] z-20 sm:hidden bg-trasparent ",children:[(0,o.jsxs)(j.v,{as:"div",className:"bg-white dark:bg-green-800 w-[75%]",children:[(0,o.jsx)("div",{className:"",children:(0,o.jsxs)(j.v.Button,{className:"inline-flex justify-center align-center p-20 bg-transparent py-2 text-md font-bold text-green-900 dark:text-green-200 dark:hover:bg-green-800 sm:hidden",children:["Award Categories",(0,o.jsx)("i",{className:"far fa-caret-down -mr-1 ml-2 w-5"})]})}),(0,o.jsx)(y.u,{as:c.Fragment,enter:"transition ease-out duration-50",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:(0,o.jsx)(j.v.Items,{className:"origin-top-left relative left-0 mt-2 border-[5px] bg-transparent border-green-600 dark:border-green-600 w-[100%] shadow-2xl",children:(0,o.jsx)("div",{className:"py-1",children:null===d||void 0===d?void 0:d.map((function(e){return(0,o.jsx)(j.v.Item,{children:t?function(t){var r=t.active;return(0,o.jsx)(Z.rU,{to:e.slug,smooth:!0,duration:200,offset:-150,className:E(r?"bg-green-700 h-10 bg-opacity-50 text-white dark:text-green-200 grid place-items-center":"text-green-800","px-4 py-2 text-lg text-center font-bold h-16 grid place-items-center dark:hover:text-white dark:text-green-200"),children:e.title})}:function(t){var r=t.active;return(0,o.jsx)("a",{href:"/category/".concat(e.slug),className:E(r?"bg-green-700 h-10 bg-opacity-50 text-white dark:text-green-200 grid place-items-center":"text-green-800","px-4 py-2 text-lg text-center font-bold h-16 grid place-items-center dark:hover:text-white dark:text-green-200"),children:e.title})}},e.slug)}))})})})]}),(0,o.jsx)("div",{className:" w-[30%] text-center ",children:(0,o.jsxs)("button",{className:"bg-white dark:bg-green-800 border-2 w-[100%] border-white dark:border-green-800 text-newGreen-medium font-semibold px-3 py-2 hover:bg-white",onClick:function(){return s(!0)},children:[(0,o.jsx)("i",{className:"far fa-search mr-2"}),"Search..."]})}),(0,o.jsx)(k(),{isOpen:n,onRequestClose:function(){return s(!1)},children:(0,o.jsx)(B.Z,{})})]})},T=r(6685),C=r(9008),R=r.n(C),M=r(2962),U=r(9953),_=function(){return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(R(),{children:[(0,o.jsx)("link",{rel:"icon",type:"image/png",sizes:"32x32",href:"/assets/favicon.png"}),(0,o.jsx)("meta",{name:"theme-color",content:"#58b745"})]}),(0,o.jsx)(M.PB,{title:"Noonies 2019 Tech Awards by HackerNoon",description:"The Noonies are the annual tech awards by HackerNoon. Voted by the community, we reward the brightest minds in software, crypto and the future of the internet.",openGraph:{title:"Noonies 2019 Tech Awards by HackerNoon",description:"The Noonies are the annual tech awards by HackerNoon. Voted by the community, we reward the brightest minds in software, crypto and the future of the internet.",images:[{url:"".concat(U._O,"/assets/social-card.jpg")}],site_name:"Noonies 2019 Tech Awards by HackerNoon"}})]})},O=function(e){var t=(0,c.useState)({awards:0,nominees:0,votes:0}),r=t[0],g=t[1],h=(0,a.Z)((0,l.Kx)(u.Z.firestore().collection("noonies-awards").where("year","==",2019),{snapshotListenOptions:{includeMetadataChanges:!0}}),2),f=h[0],p=h[1],A=(0,a.Z)((0,l.d4)(u.Z.firestore().collection("noonies-categories").where("years","array-contains",2019),{snapshotListenOptions:{includeMetadataChanges:!0}}),2),v=A[0],j=A[1],y=(0,a.Z)((0,l.Xi)(u.Z.firestore().doc("noonies-misc/".concat(String(2019)))),2),N=y[0],k=y[1],Z=(0,c.useState)([]),B=Z[0],E=Z[1];return(0,c.useEffect)((function(){if(!p&&!j){var e,t=null!==(e=null===f||void 0===f?void 0:f.docs.map((function(e){return e.data()})))&&void 0!==e?e:[];console.log({awardDocsData:t});var a=t.reduce((function(e,t){var r;return e+(null===(r=t.nominees)||void 0===r?void 0:r.length)||0}),0);g((0,s.Z)((0,n.Z)({},r),{awards:t.length,nominees:a}));var o=v.map((function(e){var r=t.filter((function(t){return t.category===e.slug})),n=r.filter((function(e){return e.featured})),s=r.filter((function(e){return!e.featured})),a=(0,i.Z)(n).concat((0,i.Z)(s));return{title:e.title,slug:e.slug,description:e.description,awards:a.slice(0,4)}}));console.log({awardCategories:o}),E(o)}}),[p,j,f,v]),(0,c.useEffect)((function(){k||g((0,s.Z)((0,n.Z)({},r),{votes:null===N||void 0===N?void 0:N.voteCount}))}),[N,k]),(0,o.jsxs)(d.Z,{children:[(0,o.jsx)(_,{}),(0,o.jsx)(b,{count:r,isVotingOpen:null===N||void 0===N?void 0:N.allowVoting}),!j&&(0,o.jsx)(x.Z,{isHome:!0,categories:v}),(0,o.jsx)(S,{isHome:!0}),(0,o.jsx)(m.Z,{children:(0,o.jsx)("div",{className:"my-12",children:p||j?(0,o.jsx)(T.Z,{}):B.length>0&&B.map((function(e,t){return(0,o.jsx)(w.Z,(0,n.Z)({isHome:!0},e),t)}))})})]})}},9815:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(943);var s=r(3375);var a=r(1566);function i(e){return function(e){if(Array.isArray(e))return(0,n.Z)(e)}(e)||(0,s.Z)(e)||(0,a.Z)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}}},function(e){e.O(0,[662,436,962,133,59,847,774,888,179],(function(){return t=8040,e(e.s=t);var t}));var t=e.O();_N_E=t}]);