From dcb6169e883e823d371df222eb6b02b8ec878ac5 Mon Sep 17 00:00:00 2001 From: FleetAdmiralJakob Date: Wed, 19 Jun 2024 19:44:22 +0200 Subject: [PATCH 1/2] chore: improved code on contributor page --- src/app/contributors/page.tsx | 106 +++++++++++++++------------------- 1 file changed, 46 insertions(+), 60 deletions(-) diff --git a/src/app/contributors/page.tsx b/src/app/contributors/page.tsx index bf5d21f2..d4bbae2d 100644 --- a/src/app/contributors/page.tsx +++ b/src/app/contributors/page.tsx @@ -2,40 +2,33 @@ import Footer from "~/components/footer"; import { IoIosArrowDropupCircle } from "react-icons/io"; -import JakobProfile from "/src/assets/jakob-profile.png"; -import FabiusProfile from "/src/assets/fabius-profile.png"; +import jakobProfile from "/src/assets/jakob-profile.png"; +import fabiusProfile from "/src/assets/fabius-profile.png"; import { IoChevronBackSharp } from "react-icons/io5"; import { FaLinkedin } from "react-icons/fa"; -import Image from "next/image"; +import Image, { type StaticImageData } from "next/image"; import { cn } from "~/lib/utils"; import { useRouter } from "next/navigation"; import { useState } from "react"; import { FaLink } from "react-icons/fa6"; import { FaGithub } from "react-icons/fa"; import { BsPeopleFill } from "react-icons/bs"; +import Link from "next/link"; interface ContributorsProps { name: string; job: string; - image: JSX.Element; + image: StaticImageData; github?: string; website?: string; linkedin?: string; } -const ContributorList: ContributorsProps[] = [ +const contributorList: ContributorsProps[] = [ { name: "Fabius Schurig", job: "Engineer & Designer", - image: ( - {"Jakob"} - ), + image: fabiusProfile, github: "https://github.com/Gamius00", website: "https://schurig.tech", linkedin: "https://www.linkedin.com/in/fabius-schurig-80713b284/", @@ -43,15 +36,7 @@ const ContributorList: ContributorsProps[] = [ { name: "Jakob Rössner", job: "Engineer", - image: ( - {"Jakob"} - ), + image: jakobProfile, github: "https://github.com/FleetAdmiralJakob", website: "https://roessner.tech", linkedin: "https://www.linkedin.com/in/jakobroessner/", @@ -77,7 +62,7 @@ const Contributors = () => {

Made with ❤️ by

- {ContributorList.map((contributor, id) => { + {contributorList.map((contributor, id) => { const [cardOpen, setCardOpen] = useState(false); return ( <> @@ -88,7 +73,13 @@ const Contributors = () => { >
-

{contributor.image}

+ {contributor.name}

@@ -120,41 +111,36 @@ const Contributors = () => { }, )} > -

{ - if (contributor.website) { - router.push(contributor.website); - } - }} - > -

Website

- -
-
{ - if (contributor.linkedin) { - router.push(contributor.linkedin); - } - }} - > -

LinkedIn

- -
-
{ - if (contributor.github) { - router.push(contributor.github); - } - }} - > -

GitHub

- -
+ {contributor.website ? ( + +

Website

+ + + ) : null} + + {contributor.linkedin ? ( + +

+ LinkedIn +

+ + + ) : null} + + {contributor.github ? ( + +

GitHub

+ + + ) : null}
From 65a003e08badd17be2126a4afcaf2953bc99a9dc Mon Sep 17 00:00:00 2001 From: FleetAdmiralJakob Date: Sat, 22 Jun 2024 09:02:37 +0200 Subject: [PATCH 2/2] fix: added an according key to every div inside the map --- src/components/chat-overview.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/chat-overview.tsx b/src/components/chat-overview.tsx index 59a1ad97..0f64a6e2 100644 --- a/src/components/chat-overview.tsx +++ b/src/components/chat-overview.tsx @@ -89,9 +89,9 @@ const Chats: React.FC<{ className={cn("w-full border-t-2 border-secondary", { "border-0": index == 0, })} + key={index} >