From e3e2baf87da529af92f6d4aa207e0e4cb0bc33ef Mon Sep 17 00:00:00 2001 From: Jamil Date: Thu, 30 Nov 2023 15:54:41 -0800 Subject: [PATCH] Use typed links to detect broken links (#2750) - Fixes firezone/gtm#220 - Add @jefferenced and @ReactorScram to team page and simplify it @conectado Interesting use of strong typing to enforce no broken links in NextJS --- website/next.config.mjs | 3 + website/src/app/page.tsx | 12 +- website/src/app/team/page.tsx | 110 +++++++++--------- website/src/components/ActionLink/index.tsx | 3 +- .../src/components/Blog/SummaryCard/index.tsx | 3 +- website/src/components/DocsSidebar/Item.tsx | 9 +- website/src/components/Footer/index.tsx | 8 +- website/src/components/Icons/index.tsx | 21 +--- website/src/components/KbSidebar/Item.tsx | 9 +- website/src/components/KbSidebar/index.tsx | 2 - 10 files changed, 98 insertions(+), 82 deletions(-) diff --git a/website/next.config.mjs b/website/next.config.mjs index f42e07f15..5b414bee7 100644 --- a/website/next.config.mjs +++ b/website/next.config.mjs @@ -31,6 +31,9 @@ const highlightLanguages = { /** @type {import('next').NextConfig} */ const nextConfig = { + experimental: { + typedRoutes: true, + }, // Proxy GitHub requests to avoid CORS issues async rewrites() { return [ diff --git a/website/src/app/page.tsx b/website/src/app/page.tsx index 8d252569d..474064b72 100644 --- a/website/src/app/page.tsx +++ b/website/src/app/page.tsx @@ -319,7 +319,7 @@ export default function Page() {
- + - + - + - + - + - + @@ -31,7 +31,7 @@ function renderTeamMember({

{name}

- {title} + {title}
diff --git a/website/src/components/Icons/index.tsx b/website/src/components/Icons/index.tsx index 9319bbaa4..568a05bfb 100644 --- a/website/src/components/Icons/index.tsx +++ b/website/src/components/Icons/index.tsx @@ -1,11 +1,8 @@ import Link from "next/link"; -export function LinkedInIcon({ url }: { url: string }) { +export function LinkedInIcon({ url }: { url: URL }) { return ( - +