Skip to content

Commit

Permalink
chore(web): generate footer icons on the fly
Browse files Browse the repository at this point in the history
AKA, move them into a list so I only have to update the jsx once.
  • Loading branch information
lishaduck committed Dec 17, 2023
1 parent dec7107 commit a4c6527
Showing 1 changed file with 37 additions and 29 deletions.
66 changes: 37 additions & 29 deletions src/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,28 @@ const Footer: FunctionalComponent = () => {
],
},
];
const icons = [
{
Icon: IconLemon2,
href: "https://fresh.deno.dev/",
name: "Fresh",
},
{
Icon: IconBrandDeno,
href: "https://deno.com/",
name: "Deno",
},
{
Icon: IconBrandReact,
href: "https://preactjs.com/",
name: "Preact",
},
{
Icon: IconBrandTailwind,
href: "https://tailwindcss.com/",
name: "Tailwind",
},
];

return (
<div class="bg-white dark:bg-black flex flex-col sm:flex-row w-full max-w-screen-xlg gap-8 md:gap-16 px-8 py-8 text-sm">
Expand Down Expand Up @@ -62,35 +84,21 @@ const Footer: FunctionalComponent = () => {
<div class="text-xs">
Made with
</div>
<a
href="https://fresh.deno.dev/"
class="inline-block hover:text-black dark:hover:text-white"
aria-label="Fresh"
>
<IconLemon2 aria-hidden="true" />
</a>
<a
href="https://deno.com/"
class="inline-block hover:text-black dark:hover:text-white"
aria-label="Deno"
>
<IconBrandDeno aria-hidden="true" />
</a>
<br />
<a
href="https://preactjs.com/"
class="inline-block hover:text-black dark:hover:text-white"
aria-label="Preact"
>
<IconBrandReact aria-hidden="true" />
</a>
<a
href="https://tailwindcss.com/"
class="inline-block hover:text-black dark:hover:text-white"
aria-label="Tailwind"
>
<IconBrandTailwind aria-hidden="true" />
</a>
{icons.map(({ Icon, href, name }, index) => {
console.log(index);
return (
<>
<a
href={href}
class="inline-block hover:text-black dark:hover:text-white"
title={name}
>
<Icon aria-hidden="true" />
</a>
{index % 2 === 1 ? <br /> : <></>}
</>
);
})}
</div>
</div>
);
Expand Down

0 comments on commit a4c6527

Please sign in to comment.