From 3aefe4fa88c5b288ec385d7d565c6cabdc079b10 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 21 Nov 2022 17:04:07 +0100 Subject: [PATCH] fix(frontend): limit avatar size --- frontend/components/FallbackImage.tsx | 6 ++++-- frontend/components/PersonPage.tsx | 26 ++++++++++++++++++++------ 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/frontend/components/FallbackImage.tsx b/frontend/components/FallbackImage.tsx index 5ccca12..ffd8493 100644 --- a/frontend/components/FallbackImage.tsx +++ b/frontend/components/FallbackImage.tsx @@ -23,9 +23,11 @@ export default function FallbackImage({ urls, alt, className }: Props) { } else { contentType = "application/octet-stream"; } - return ; + return ( + + ); })} - {alt} + {alt} ); } diff --git a/frontend/components/PersonPage.tsx b/frontend/components/PersonPage.tsx index 633a24d..ed13e74 100644 --- a/frontend/components/PersonPage.tsx +++ b/frontend/components/PersonPage.tsx @@ -1,5 +1,14 @@ import Head from "next/head"; -import { Field, Member, Name, PartialPerson, Person, Pronoun, User, WordStatus } from "../lib/types"; +import { + Field, + Member, + Name, + PartialPerson, + Person, + Pronoun, + User, + WordStatus, +} from "../lib/types"; import ReactMarkdown from "react-markdown"; import { userState } from "../lib/state"; import { useRecoilValue } from "recoil"; @@ -41,10 +50,13 @@ export default function PersonPage({ person }: { person: Person }) { - {"user" in person - ? {`< ${person.user.display_name}`} - : - } + {"user" in person ? ( + {`< ${ + person.user.display_name ?? person.user.name + }`} + ) : ( + + )} ); @@ -203,7 +215,9 @@ function PersonInfo({ person }: { person: Person }) { return (
{/* name */} -

{display_name === null ? name : display_name}

+

+ {display_name === null ? name : display_name} +

{/* handle */}

{personFullHandle(person)}