From 4aecc0eab2c606ebe3c12dddc284dc9ab15570bc Mon Sep 17 00:00:00 2001 From: Matt Roberts Date: Sun, 29 Sep 2024 16:28:11 +0100 Subject: [PATCH] Username component shouldn't show email unless explicitly requested --- public/components/common/UserName.tsx | 3 ++- public/pages/Administration/pages/ManageMembers.page.tsx | 2 +- public/pages/ShowPost/components/VotesModal.tsx | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/public/components/common/UserName.tsx b/public/components/common/UserName.tsx index b7a7eb7a7..0f06751a7 100644 --- a/public/components/common/UserName.tsx +++ b/public/components/common/UserName.tsx @@ -11,6 +11,7 @@ interface UserNameProps { role?: UserRole email?: string } + showEmail?: boolean } export const UserName = (props: UserNameProps) => { @@ -23,7 +24,7 @@ export const UserName = (props: UserNameProps) => { return (
{props.user.name || "Anonymous"} - <>{props.user.email && ({props.user.email})} + <>{props.showEmail && props.user.email && ({props.user.email})} {isStaff && (
diff --git a/public/pages/Administration/pages/ManageMembers.page.tsx b/public/pages/Administration/pages/ManageMembers.page.tsx index a9178314d..19045bae9 100644 --- a/public/pages/Administration/pages/ManageMembers.page.tsx +++ b/public/pages/Administration/pages/ManageMembers.page.tsx @@ -38,7 +38,7 @@ const UserListItem = (props: UserListItemProps) => { - + {admin} {collaborator} {blocked} diff --git a/public/pages/ShowPost/components/VotesModal.tsx b/public/pages/ShowPost/components/VotesModal.tsx index 708baa1f9..770a8c7f7 100644 --- a/public/pages/ShowPost/components/VotesModal.tsx +++ b/public/pages/ShowPost/components/VotesModal.tsx @@ -70,7 +70,7 @@ export const VotesModal: React.FC = (props) => { - + {x.user.email}