diff --git a/client/src/contributor-spotlight/index.tsx b/client/src/contributor-spotlight/index.tsx index 9abc4bf2fd42..35261fd4a89d 100644 --- a/client/src/contributor-spotlight/index.tsx +++ b/client/src/contributor-spotlight/index.tsx @@ -9,6 +9,8 @@ import { Quote } from "../ui/molecules/quote"; import "./index.scss"; import { useLocale } from "../hooks"; +import { PageNotFound } from "../page-not-found"; +import { Loading } from "../ui/atoms/loading"; type ContributorDetails = { sections: [string]; @@ -31,7 +33,7 @@ export function ContributorSpotlight(props: HydrationData) { const fallbackData = props.hyData ? props : undefined; - const { data: { hyData } = {} } = useSWR( + const { error, data: { hyData } = {} } = useSWR( contributorJSONUrl, async (url) => { const response = await fetch(url); @@ -55,37 +57,39 @@ export function ContributorSpotlight(props: HydrationData) { document.title = pageTitle; }, [hyData]); + if (error) { + return ; + } else if (!hyData) { + return ; + } + return ( <>
- {hyData && ( - <> -

Contributor profile

-
- {hyData.profileImgAlt} - - @{hyData.usernames.github} - -
-
- {hyData.quote} +

Contributor profile

+
+ {hyData.profileImgAlt} + + @{hyData.usernames.github} + +
+
+ {hyData.quote} - {hyData.sections.slice(1).map((section) => { - return
; - })} - - )} + {hyData.sections.slice(1).map((section) => { + return
; + })}