fix(mobile): show both initials in a round header avatar

The 24 pt initials avatar padded its text into 8 pt, so "SW" wrapped and
showed only "S". On Android it also turned square after sign-in, as the
unfilled signed-out view was flattened and recreated without its corner
radius. Drop the padding, keep the initials on one line, never flatten.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
DIYgod
2026-10-12 21:17:05 +08:00
parent a949cef043
commit b0dca1e528
@@ -75,6 +75,9 @@ export const UserAvatar = ({
if (!image) {
return (
<View
// Without a fill, as while signed out, this view is flattened away. Android creates it with
// only the props that changed once the name arrives, so it would lose its round corners.
collapsable={false}
className={cn(
"items-center justify-center rounded-full",
name && "bg-tertiary-system-fill",
@@ -88,10 +91,11 @@ export const UserAvatar = ({
{name ? (
<Text
allowFontScaling={false}
className="p-2 text-center uppercase text-secondary-label"
className="text-center uppercase text-secondary-label"
style={{
fontSize: size / 3,
}}
numberOfLines={1}
adjustsFontSizeToFit
>
{name.slice(0, 2)}