fix(webui): align provider icons across compact surfaces
This commit is contained in:
1 parent
5aac672b98
commit
f4d863a148
7 files changed
+149
-9
No files matched your search
@@ -38,6 +38,7 @@ import type {
|
||||
} from "@/lib/local-preferences";
|
||||
import { providerBrand, providerDisplayLabel } from "@/lib/provider-brand";
|
||||
import type { SettingsPayload } from "@/lib/types";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { useClient } from "@/providers/ClientProvider";
|
||||
|
||||
export function OverviewSettings({
|
||||
@@ -405,7 +406,8 @@ function OverviewValueLogo({
|
||||
showBrandLogos: boolean;
|
||||
}) {
|
||||
const brand = provider ? providerBrand(provider) : null;
|
||||
const { logoUrl, onLogoError, onLogoLoad } = useLogoFallback(brand?.logoUrls);
|
||||
const { logoUrl, logoLoaded, onLogoError, onLogoLoad } = useLogoFallback(brand?.logoUrls);
|
||||
const isLogoTile = brand?.logoLayout === "tile" && logoUrl === brand.logoUrl;
|
||||
|
||||
if (!provider || !showBrandLogos || !brand) return null;
|
||||
|
||||
@@ -413,7 +415,10 @@ function OverviewValueLogo({
|
||||
return (
|
||||
<span
|
||||
data-testid={`overview-logo-${provider}`}
|
||||
className="grid h-5 w-5 shrink-0 place-items-center overflow-hidden rounded-md border border-border/35 bg-background"
|
||||
className={cn(
|
||||
"grid h-5 w-5 shrink-0 place-items-center overflow-hidden rounded-md",
|
||||
logoLoaded ? (isLogoTile ? "bg-transparent" : "bg-white") : "bg-muted",
|
||||
)}
|
||||
aria-hidden
|
||||
>
|
||||
<img
|
||||
@@ -421,7 +426,13 @@ function OverviewValueLogo({
|
||||
alt=""
|
||||
decoding="async"
|
||||
loading="lazy"
|
||||
className="h-3.5 w-3.5 object-contain"
|
||||
referrerPolicy="no-referrer"
|
||||
draggable={false}
|
||||
className={cn(
|
||||
"object-contain",
|
||||
isLogoTile ? "h-5 w-5" : "h-3.5 w-3.5",
|
||||
logoLoaded ? "opacity-100" : "opacity-0",
|
||||
)}
|
||||
onLoad={onLogoLoad}
|
||||
onError={onLogoError}
|
||||
/>
|
||||
|
||||
@@ -501,7 +501,8 @@ export function ProviderPickerIcon({
|
||||
}) {
|
||||
const brand = providerBrand(provider);
|
||||
const Icon = PROVIDER_ICONS[provider] ?? Hexagon;
|
||||
const { logoUrl, onLogoError, onLogoLoad } = useLogoFallback(brand?.logoUrls);
|
||||
const { logoUrl, logoLoaded, onLogoError, onLogoLoad } = useLogoFallback(brand?.logoUrls);
|
||||
const isLogoTile = brand?.logoLayout === "tile" && logoUrl === brand.logoUrl;
|
||||
|
||||
if (unconfigured) {
|
||||
return (
|
||||
@@ -519,7 +520,10 @@ export function ProviderPickerIcon({
|
||||
return (
|
||||
<span
|
||||
data-testid={`provider-picker-logo-${provider}`}
|
||||
className="grid h-5 w-5 shrink-0 place-items-center overflow-hidden rounded-md border border-border/35 bg-background"
|
||||
className={cn(
|
||||
"grid h-5 w-5 shrink-0 place-items-center overflow-hidden rounded-md",
|
||||
logoLoaded ? (isLogoTile ? "bg-transparent" : "bg-white") : "bg-muted",
|
||||
)}
|
||||
aria-hidden
|
||||
>
|
||||
<img
|
||||
@@ -527,7 +531,13 @@ export function ProviderPickerIcon({
|
||||
alt=""
|
||||
decoding="async"
|
||||
loading="lazy"
|
||||
className="h-3.5 w-3.5 object-contain"
|
||||
referrerPolicy="no-referrer"
|
||||
draggable={false}
|
||||
className={cn(
|
||||
"object-contain",
|
||||
isLogoTile ? "h-5 w-5" : "h-3.5 w-3.5",
|
||||
logoLoaded ? "opacity-100" : "opacity-0",
|
||||
)}
|
||||
onLoad={onLogoLoad}
|
||||
onError={onLogoError}
|
||||
/>
|
||||
|
||||
Reference in new issue
Block a user