Unique keys

This commit is contained in:
Daniel Kluge 2022-10-30 13:31:06 +01:00
parent 7e6f8b3b2f
commit a8710a96b6
2 changed files with 6 additions and 8 deletions

View File

@ -11,6 +11,8 @@ interface ILayoutProps {
} }
const Layout: NextPage<ILayoutProps> = ({ title, children }) => { const Layout: NextPage<ILayoutProps> = ({ title, children }) => {
const socialLinks = socials("1.1em").map((social, i) => <a key={i} href={social.url} target="_blank" rel="noreferrer" className={styles.socialIcon}>{social.icon}</a>);
return <> return <>
<Head> <Head>
<title>{title ?? "c0ntroller.de"}</title> <title>{title ?? "c0ntroller.de"}</title>
@ -29,10 +31,7 @@ const Layout: NextPage<ILayoutProps> = ({ title, children }) => {
<span className={styles.footerContent}> <span className={styles.footerContent}>
<span>© 2022 Daniel Kluge</span> <span>© 2022 Daniel Kluge</span>
<span className={styles.divider}>|</span> <span className={styles.divider}>|</span>
{socials("1.1em").map((social, i) => <> {socialLinks.flatMap((social, i) => i !== 0 ? [<span className={styles.divider} key={`d${i}`}>|</span>, social] : [social])}
{i !== 0 ? <span className={styles.divider} key={`d${i}`}>|</span> : null}
<a key={i} href={social.url} target="_blank" rel="noreferrer" className={styles.socialIcon}>{social.icon}</a>
</>)}
<span className={styles.divider}>|</span> <span className={styles.divider}>|</span>
<a className="nostyle" target="_blank" href="mailto:admin-website@c0ntroller.de" rel="noreferrer">Contact</a> <a className="nostyle" target="_blank" href="mailto:admin-website@c0ntroller.de" rel="noreferrer">Contact</a>
</span> </span>

View File

@ -56,6 +56,8 @@ const Terminal: NextPage<{ buildTime: string }> = ({ buildTime }) => {
const iconSize = "1.3em"; const iconSize = "1.3em";
const socialLinks = socials(iconSize, "var(--repl_color)").map((social, i) => <a key={i} href={social.url} target="_blank" rel="noreferrer" className={styles.iconLink}>{social.icon}</a>);
return (<main onKeyDown={hideModalOnEsc} tabIndex={-1}> return (<main onKeyDown={hideModalOnEsc} tabIndex={-1}>
<Head> <Head>
<title>c0ntroller.de</title> <title>c0ntroller.de</title>
@ -72,10 +74,7 @@ const Terminal: NextPage<{ buildTime: string }> = ({ buildTime }) => {
<span className={styles.divider}>|</span> <span className={styles.divider}>|</span>
<a href="mailto:admin-website@c0ntroller.de" rel="noreferrer" target="_blank" className={styles.iconLink}><Icon path={mdiEmail} color="var(--repl_color)" size="1.5em" id="mdi_terminal_nav_email" title="Email" /></a> <a href="mailto:admin-website@c0ntroller.de" rel="noreferrer" target="_blank" className={styles.iconLink}><Icon path={mdiEmail} color="var(--repl_color)" size="1.5em" id="mdi_terminal_nav_email" title="Email" /></a>
<span className={styles.divider}>|</span> <span className={styles.divider}>|</span>
{socials(iconSize, "var(--repl_color)").map((social, i) => <> {socialLinks.flatMap((social, i) => i !== 0 ? [<span className={styles.divider} key={`d${i}`}>|</span>, social] : [social])}
{i !== 0 ? <span className={styles.divider} key={`d${i}`}>|</span> : null}
<a key={i} href={social.url} target="_blank" rel="noreferrer" className={styles.iconLink}>{social.icon}</a>
</>)}
<span className={styles.spacer} onClick={focusInput}>&nbsp;</span> <span className={styles.spacer} onClick={focusInput}>&nbsp;</span>
</div> </div>
<REPL inputRef={inputRef} buildTime={buildTime} /> <REPL inputRef={inputRef} buildTime={buildTime} />