From 7bd443226a2d1d5592ee12fdc82d324d70d9cfdb Mon Sep 17 00:00:00 2001 From: River Holstege Date: Fri, 22 Sep 2023 12:11:11 -0700 Subject: [PATCH] format --- .../src/components/People/PersonDetails.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Keas.Mvc/ClientApp/src/components/People/PersonDetails.tsx b/Keas.Mvc/ClientApp/src/components/People/PersonDetails.tsx index eb419958f..2fff63f5c 100644 --- a/Keas.Mvc/ClientApp/src/components/People/PersonDetails.tsx +++ b/Keas.Mvc/ClientApp/src/components/People/PersonDetails.tsx @@ -41,6 +41,16 @@ const PersonDetails = (props: IProps) => { const canEdit = PermissionsUtil.canEditPeople(context.permissions); + // this is the only place we render pronouns. if we use them elsewhere, we should move this to a util + const formatPronouns = (pronouns: string) => { + pronouns = pronouns.trim(); + if (pronouns.startsWith('(') && pronouns.endsWith(')')) { + return pronouns; // if user has, say "(they/them" then that's their problem and i don't care + } else { + return `(${pronouns})`; + } + }; + return (
@@ -57,7 +67,9 @@ const PersonDetails = (props: IProps) => { {props.selectedPersonInfo.person.name}{' '}
{!!props.selectedPersonInfo.person.user?.pronouns && - props.selectedPersonInfo.person.user.pronouns} + formatPronouns( + props.selectedPersonInfo.person.user.pronouns + )}