From a8710a96b696a5d066f975cb51690e4b04a22ed3 Mon Sep 17 00:00:00 2001 From: Daniel Kluge Date: Sun, 30 Oct 2022 13:31:06 +0100 Subject: [PATCH] Unique keys --- components/Blog/Layout.tsx | 7 +++---- pages/terminal.tsx | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/components/Blog/Layout.tsx b/components/Blog/Layout.tsx index 6d64f10..eb66697 100644 --- a/components/Blog/Layout.tsx +++ b/components/Blog/Layout.tsx @@ -11,6 +11,8 @@ interface ILayoutProps { } const Layout: NextPage = ({ title, children }) => { + const socialLinks = socials("1.1em").map((social, i) => {social.icon}); + return <> {title ?? "c0ntroller.de"} @@ -29,10 +31,7 @@ const Layout: NextPage = ({ title, children }) => { © 2022 Daniel Kluge | - {socials("1.1em").map((social, i) => <> - {i !== 0 ? | : null} - {social.icon} - )} + {socialLinks.flatMap((social, i) => i !== 0 ? [|, social] : [social])} | Contact diff --git a/pages/terminal.tsx b/pages/terminal.tsx index 1f08b8e..5939cff 100644 --- a/pages/terminal.tsx +++ b/pages/terminal.tsx @@ -56,6 +56,8 @@ const Terminal: NextPage<{ buildTime: string }> = ({ buildTime }) => { const iconSize = "1.3em"; + const socialLinks = socials(iconSize, "var(--repl_color)").map((social, i) => {social.icon}); + return (
c0ntroller.de @@ -72,10 +74,7 @@ const Terminal: NextPage<{ buildTime: string }> = ({ buildTime }) => { | | - {socials(iconSize, "var(--repl_color)").map((social, i) => <> - {i !== 0 ? | : null} - {social.icon} - )} + {socialLinks.flatMap((social, i) => i !== 0 ? [|, social] : [social])}