-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcomponent---src-pages-index-js-ebac5de427b26eeaa495.js
1 lines (1 loc) · 2.27 KB
/
component---src-pages-index-js-ebac5de427b26eeaa495.js
1
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[293],{94:function(e,t,a){a.r(t),a.d(t,{default:function(){return b}});var r=a(6783),n=a.n(r),l=a(8651),o=a.n(l),s=a(9474),c=a(2983),d=a(5832),i=a(9980),m=a(1875),g=a(4723),u=a(2723);const f="favoriteMakers";function p(){const e=(0,u.h8)(f);if(e)try{return JSON.parse(e)}catch(t){console.error("Unable to read favorite makers",t),console.log(e)}return[]}var k=a(9443);var b=()=>{const e=(0,c.GR)("3811116095"),t=e.allFile.nodes,a=e=>{const a=t.find((t=>t.name===e));return o()(a)?(0,d.c)(t.find((e=>"nologo"===e.name))):(0,d.c)(a)},{0:r,1:l}=(0,s.useState)([]);(0,s.useEffect)((()=>{const e=p();e&&l(e)}),p());const b=n()(e.allSitePage.nodes,(e=>!r.includes(e.pageContext.maker.id)));return s.createElement(m.A,null,s.createElement(g.A,{title:"",img:"/android-icon-512x512.png"}),s.createElement("ul",{className:"grid grid-cols-2 gap-2 md:grid-cols-4 lg:grid-cols-5 lg:gap-4"},b.map((e=>s.createElement("li",{key:e.id,className:"flex flex-col"},s.createElement(c.N_,{to:e.path,className:(0,k.A)("block w-full overflow-hidden rounded-md bg-white shadow-md transition","hover:border-slate-400/80 hover:shadow-lg","dark:border dark:border-slate-600/50 dark:bg-slate-700 dark:text-slate-200 dark:shadow-none")},s.createElement("div",{className:"w-full border-b border-slate-200 bg-white dark:border-b-2 dark:border-slate-600"},s.createElement(d.G,{image:a(e.pageContext.maker.id),className:"block rounded-t-md",alt:e.pageContext.maker.name,width:"500",height:"500"})),s.createElement("div",{className:"text-header flex items-center justify-between gap-x-2 p-4"},s.createElement("span",{className:"grow text-center font-semibold max-lg:truncate lg:text-lg lg:font-bold"},e.pageContext.maker.name),s.createElement("button",{className:"p-1 lg:p-px",onClick:t=>{t.preventDefault();const a=r.includes(e.pageContext.maker.id)?function(e){let t=p();return t=t.filter((t=>t!==e)),(0,u.Fn)(f,JSON.stringify(t)),t}(e.pageContext.maker.id):function(e){const t=p();return t.find((t=>t===e))||(t.push(e),(0,u.Fn)(f,JSON.stringify(t))),t}(e.pageContext.maker.id);l(a)}},s.createElement(i.g,{id:"favStar",className:(0,k.A)("top-[14px] ml-auto cursor-pointer",r.includes(e.pageContext.maker.id)?"text-yellow-500":"text-slate-400"),icon:["fas","star"]})))))))))}}}]);