From 8f9a8ddce022e328b07b793c3f1500e1c423ef73 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Tue, 1 Jul 2025 23:24:20 +0300 Subject: [PATCH] enforce border radius on default avatar (#8577) --- src/view/com/util/UserAvatar.tsx | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/view/com/util/UserAvatar.tsx b/src/view/com/util/UserAvatar.tsx index 3a7dcca3dc..97cd831b39 100644 --- a/src/view/com/util/UserAvatar.tsx +++ b/src/view/com/util/UserAvatar.tsx @@ -98,6 +98,13 @@ let DefaultAvatar = ({ size: number }): React.ReactNode => { const finalShape = overrideShape ?? (type === 'user' ? 'circle' : 'square') + + const aviStyle = useMemo(() => { + if (finalShape === 'square') { + return {borderRadius: size > 32 ? 8 : 3, overflow: 'hidden'} as const + } + }, [finalShape, size]) + if (type === 'algo') { // TODO: shape=circle // Font Awesome Pro 6.4.0 by @fontawesome -https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. @@ -108,7 +115,8 @@ let DefaultAvatar = ({ height={size} viewBox="0 0 32 32" fill="none" - stroke="none"> + stroke="none" + style={aviStyle}> + stroke="none" + style={aviStyle}> + stroke="none" + style={aviStyle}> {finalShape === 'square' ? ( + stroke="none" + style={aviStyle}>