Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(providers): badge initials stay readable on light accent colors #16128

Mergedipanasenko(GitHub profile, opens in a new tab)merged 15 commits intomain fromrefs/pull/16128/headmerged by juliusmarminge View on GitHub

Showing 4 changed files with 35 additions and 11 deletions (loading 1).

x
0 of 4 viewed, 4 left
10 additions and 5 deletionsapps/mobile/src/components/ProviderIcon.tsxModified
View file
@@ -1,7 +1,11 @@
import { Image } from "expo-image";
import { Defs, LinearGradient, Path, Stop, Svg } from "react-native-svg";
import { View } from "react-native";
-import { providerInstanceInitials } from "@t3tools/client-runtime/state/provider-instance-display";
+import {
+ normalizeProviderAccentColor,
+ providerAccentForegroundColor,
+ providerInstanceInitials,
+} from "@t3tools/client-runtime/state/provider-instance-display";
import { useId, useState } from "react";
import { resolveOfficialAcpRegistryIconUrl } from "@t3tools/contracts";
import { useAppearancePreferences } from "../features/settings/appearance/AppearancePreferencesProvider";
@@ -156,6 +160,7 @@
readonly showBadge?: boolean;
readonly surfaceColor: string;
}) {
+ const accentColor = normalizeProviderAccentColor(props.accentColor);
return (
<View style={{ position: "relative" }}>
<View style={{ opacity: 0.6 }}>
@@ -169,7 +174,7 @@
style={{ position: "absolute", right: -3, bottom: -3, width: 32, alignItems: "flex-end" }}
<View
- className={props.accentColor ? undefined : "bg-card"}
+ className={accentColor ? undefined : "bg-card"}
style={{
height: 12,