Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): show the provider account badge on thread rows #9899

Mergedvitalyiegorov(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/9899/headmerged by juliusmarminge View on GitHub

Showing 11 changed files with 62 additions and 18 deletions (loading 8).

x
0 of 11 viewed, 11 left
58 additions and 0 deletionsapps/mobile/src/components/ProviderIcon.tsxModified
View file
@@ -1,6 +1,9 @@
import { Image } from "expo-image";
import { Path, Svg } from "react-native-svg";
+import { View } from "react-native";
+import { providerInstanceInitials } from "@t3tools/client-runtime/state/provider-instance-display";
import { useAppearancePreferences } from "../features/settings/appearance/AppearancePreferencesProvider";
+import { AppText as Text } from "./AppText";
​
type ProviderIconProps = {
readonly provider: string | null | undefined;
@@ -80,3 +83,58 @@
</Svg>
);
+​
+/**
+ * `ProviderIcon` plus the web sidebar's account badge: an accent-color
+ * initials bubble in the bottom-right corner, drawn when `showBadge` is set
+ * (accent color present, or several instances share this driver). The glyph
+ * dims to 60% opacity while the badge stays fully saturated, matching
+ * `apps/web/src/components/chat/ProviderInstanceIcon.tsx`.
+ */
+export function ProviderInstanceIcon(props: {
+ readonly provider: string | null | undefined;
+ readonly size?: number;
+ readonly displayName: string;
+ readonly accentColor?: string;
+ readonly showBadge?: boolean;
+ readonly surfaceColor: string;
+}) {