From d193ff48877699811718512b081e46595f46ff7c Mon Sep 17 00:00:00 2001 From: Timo Erdelt Date: Mon, 25 Mar 2024 12:45:55 +0100 Subject: [PATCH] feat: add meet-{teamMemberName} page to redirect to calendars if present --- src/app/[calendarRedirect]/page.tsx | 29 ++++++++++++ src/components/home/WhoWeAre.tsx | 71 +++++------------------------ src/constant/models.ts | 12 ++++- src/constant/teamMembers.tsx | 66 +++++++++++++++++++++++++++ 4 files changed, 118 insertions(+), 60 deletions(-) create mode 100644 src/app/[calendarRedirect]/page.tsx create mode 100644 src/constant/teamMembers.tsx diff --git a/src/app/[calendarRedirect]/page.tsx b/src/app/[calendarRedirect]/page.tsx new file mode 100644 index 0000000..8d21e0d --- /dev/null +++ b/src/app/[calendarRedirect]/page.tsx @@ -0,0 +1,29 @@ +import { notFound, redirect } from 'next/navigation' + +import { teamMembers } from '@/constant/teamMembers' + +type MeetTeamMemberProps = { + params: { + calendarRedirect: string + } +} +export function generateStaticParams() { + return teamMembers + .map((teamMember) => ({ + calendarRedirect: teamMember.calendarRedirectSegment, + })) + .filter((url) => !!url) +} + +export default function MeetTeamMember({ + params: { calendarRedirect }, +}: MeetTeamMemberProps) { + const teamMember = teamMembers.find( + (member) => member.calendarRedirectSegment === calendarRedirect, + ) + if (!teamMember || !teamMember.calendarLink) { + notFound() + } else { + redirect(teamMember.calendarLink) + } +} diff --git a/src/components/home/WhoWeAre.tsx b/src/components/home/WhoWeAre.tsx index 9b141df..b3ff0eb 100644 --- a/src/components/home/WhoWeAre.tsx +++ b/src/components/home/WhoWeAre.tsx @@ -6,10 +6,7 @@ import { cn } from '@/lib/utils' import NextLink from '@/components/NextLink' -import KenoLogo from '~/svg/who-we-are-keno.svg' -import PhilippLogo from '~/svg/who-we-are-philipp.svg' -import TimoLogo from '~/svg/who-we-are-timo.svg' -import TomLogo from '~/svg/who-we-are-tom.svg' +import { teamMembers } from '@/constant/teamMembers' function ExternalReferences({ linkedInLink, @@ -89,61 +86,17 @@ export default function WhoWeAre() {

Who We Are

- - Co-Founder, Backend Developer -
- and Cloud-Native Specialist - - } - linkedInLink='https://www.linkedin.com/in/tom-graupner/' - gitHubLink='https://github.com/tgraupne' - calendarLink='https://calendar.app.google/KicY9pSkoYKqWzZP8' - /> - - Co-Founder, Full-Stack Engineer -
- and Machine Learning Specialist - - } - linkedInLink='https://www.linkedin.com/in/kenodressel/' - gitHubLink='https://github.com/kenodressel' - calendarLink='https://calendar.app.google/vL9yUjz599Xcdx9q8' - /> - - Co-Founder, Full-Stack Engineer -
- and Blockchain Specialist - - } - linkedInLink='https://www.linkedin.com/in/philipp-piwowarsky/' - gitHubLink='https://github.com/thepiwo' - calendarLink='https://calendar.app.google/eJDr4qYncBod3xsi7' - /> - - Full-Stack Engineer, Green IT, Functional -
- Programming, User-Centered Design - - } - linkedInLink='https://www.linkedin.com/in/timoerdelt/' - gitHubLink='https://github.com/tmrdlt' - /> + {teamMembers.map((teamMember, key) => ( + + ))}
diff --git a/src/constant/models.ts b/src/constant/models.ts index 3aee17a..5293b6b 100644 --- a/src/constant/models.ts +++ b/src/constant/models.ts @@ -1,4 +1,4 @@ -import { ReactElement } from 'react' +import { FC, ReactElement, SVGProps } from 'react' export type Testimonial = { source: string @@ -26,3 +26,13 @@ export type Post = { meta: Meta content: ReactElement } + +export type TeamMember = { + name: string + logo: FC> + description: ReactElement + linkedInLink: string + gitHubLink: string + calendarLink?: string + calendarRedirectSegment?: string // local url segment used to redirect to calendar link ({baseUrl}/{calendarRedirectUrl}) +} diff --git a/src/constant/teamMembers.tsx b/src/constant/teamMembers.tsx new file mode 100644 index 0000000..11d8c5a --- /dev/null +++ b/src/constant/teamMembers.tsx @@ -0,0 +1,66 @@ +import { TeamMember } from '@/constant/models' + +import KenoLogo from '~/svg/who-we-are-keno.svg' +import PhilippLogo from '~/svg/who-we-are-philipp.svg' +import TimoLogo from '~/svg/who-we-are-timo.svg' +import TomLogo from '~/svg/who-we-are-tom.svg' +export const teamMembers: TeamMember[] = [ + { + name: 'Tom Graupner', + logo: TomLogo, + description: ( + <> + Co-Founder, Backend Developer +
+ and Cloud-Native Specialist + + ), + linkedInLink: 'https://www.linkedin.com/in/tom-graupner/', + gitHubLink: 'https://github.com/tgraupne', + calendarLink: 'https://calendar.app.google/KicY9pSkoYKqWzZP8', + calendarRedirectSegment: 'meet-tom', + }, + { + name: 'Keno Dreßel', + logo: KenoLogo, + description: ( + <> + Co-Founder, Full-Stack Engineer +
+ and Machine Learning Specialist + + ), + linkedInLink: 'https://www.linkedin.com/in/kenodressel/', + gitHubLink: 'https://github.com/kenodressel', + calendarLink: 'https://calendar.app.google/vL9yUjz599Xcdx9q8', + calendarRedirectSegment: 'meet-keno', + }, + { + name: 'Philipp Piwowarsky', + logo: PhilippLogo, + description: ( + <> + Co-Founder, Full-Stack Engineer +
+ and Blockchain Specialist + + ), + linkedInLink: 'https://www.linkedin.com/in/philipp-piwowarsky/', + gitHubLink: 'https://github.com/thepiwo', + calendarLink: 'https://calendar.app.google/eJDr4qYncBod3xsi7', + calendarRedirectSegment: 'meet-philipp', + }, + { + name: 'Timo Erdelt', + logo: TimoLogo, + description: ( + <> + Full-Stack Engineer, Green IT, Functional +
+ Programming, User-Centered Design + + ), + linkedInLink: 'https://www.linkedin.com/in/timoerdelt/', + gitHubLink: 'https://github.com/tmrdlt', + }, +]