Skip to content
TypeScript

fix(mobile): account badges no longer clip wide initials like WO (#15908)

Vitaly Iegorove76d648f9605
diff --git a/apps/mobile/src/components/ProviderIcon.tsx b/apps/mobile/src/components/ProviderIcon.tsx
index 4d8680c81e1..c087b9dcfc8 100644
--- a/apps/mobile/src/components/ProviderIcon.tsx
+++ b/apps/mobile/src/components/ProviderIcon.tsx
@@ -162,34 +162,38 @@ export function ProviderInstanceIcon(props: {
<ProviderIcon iconUrl={props.iconUrl} provider={props.provider} size={props.size} />
</View>
{props.showBadge ? (
+ // A wide right-aligned box lets the badge fit its initials. Alone, an
+ // absolute badge is capped at the icon's width, which clips "WO".
<View
- className={props.accentColor ? undefined : "bg-card"}
- style={{
- position: "absolute",
- right: -3,
- bottom: -3,
- height: 12,
- minWidth: 12,
- paddingHorizontal: 2,
- borderRadius: 999,
- borderWidth: 1,
- borderColor: props.surfaceColor,
- backgroundColor: props.accentColor,
- alignItems: "center",
- justifyContent: "center",
- }}
+ pointerEvents="none"
+ style={{ position: "absolute", right: -3, bottom: -3, width: 32, alignItems: "flex-end" }}
>
- <Text
- className={props.accentColor ? undefined : "text-foreground-muted"}
+ <View
+ className={props.accentColor ? undefined : "bg-card"}
style={{
- fontSize: 7,
- fontWeight: "600",
- lineHeight: 9,
- color: props.accentColor ? "#ffffff" : undefined,
+ height: 12,
+ minWidth: 12,
+ paddingHorizontal: 2,
+ borderRadius: 999,
+ borderWidth: 1,
+ borderColor: props.surfaceColor,
+ backgroundColor: props.accentColor,
+ alignItems: "center",
+ justifyContent: "center",
}}
>
- {providerInstanceInitials(props.displayName)}
- </Text>
+ <Text
+ className={props.accentColor ? undefined : "text-foreground-muted"}
+ style={{
+ fontSize: 7,
+ fontWeight: "600",
+ lineHeight: 9,
+ color: props.accentColor ? "#ffffff" : undefined,
+ }}
+ >
+ {providerInstanceInitials(props.displayName)}
+ </Text>
+ </View>
</View>
) : null}
</View>