Skip to content

Commit 3601a2e

Browse files
authored
🤖 feat: use circle GatewayIcon for mux-gateway provider (#961)
_Generated with `mux`_ Replace the 1MB embedded PNG MuxIcon with the clean SVG GatewayIcon (circle with M letter) for the mux-gateway provider. **Changes:** - Import GatewayIcon instead of MuxIcon in ProviderIcon.tsx - Remove BITMAP_ICON_PROVIDERS set and associated CSS filter logic - GatewayIcon is a native SVG that inherits currentColor automatically, matching other provider icons
1 parent ac179e5 commit 3601a2e

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

src/browser/components/Messages/ModelDisplay.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ export const ModelDisplay: React.FC<ModelDisplayProps> = ({ modelString, showToo
5555

5656
const content = (
5757
<span className="inline normal-case" data-model-display>
58-
{isMuxGateway && (
59-
<ProviderIcon provider="mux-gateway" className={iconClass} data-model-icon="mux" />
60-
)}
6158
<ProviderIcon provider={iconProvider} className={iconClass} data-model-icon />
6259
<span className="inline">
6360
{displayName}

src/browser/components/ProviderIcon.tsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import OpenAIIcon from "@/browser/assets/icons/openai.svg?react";
44
import GoogleIcon from "@/browser/assets/icons/google.svg?react";
55
import XAIIcon from "@/browser/assets/icons/xai.svg?react";
66
import AWSIcon from "@/browser/assets/icons/aws.svg?react";
7-
import MuxIcon from "@/browser/assets/icons/mux.svg?react";
7+
import { GatewayIcon } from "@/browser/components/icons/GatewayIcon";
88
import { PROVIDER_DISPLAY_NAMES, type ProviderName } from "@/common/constants/providers";
99
import { cn } from "@/common/lib/utils";
1010

@@ -14,11 +14,11 @@ const PROVIDER_ICONS: Partial<Record<ProviderName, React.FC>> = {
1414
google: GoogleIcon,
1515
xai: XAIIcon,
1616
bedrock: AWSIcon,
17-
"mux-gateway": MuxIcon,
17+
"mux-gateway": GatewayIcon,
1818
};
1919

20-
// Providers with bitmap logos that need CSS filters for consistent appearance
21-
const BITMAP_ICON_PROVIDERS = new Set<string>(["mux-gateway"]);
20+
// Icons that use stroke instead of fill for their styling
21+
const STROKE_BASED_ICONS = new Set<string>(["mux-gateway"]);
2222

2323
export interface ProviderIconProps {
2424
provider: string;
@@ -33,14 +33,16 @@ export function ProviderIcon(props: ProviderIconProps) {
3333
const IconComponent = PROVIDER_ICONS[props.provider as keyof typeof PROVIDER_ICONS];
3434
if (!IconComponent) return null;
3535

36-
const isBitmap = BITMAP_ICON_PROVIDERS.has(props.provider);
36+
const isStrokeBased = STROKE_BASED_ICONS.has(props.provider);
3737

3838
return (
3939
<span
4040
className={cn(
41-
"inline-block h-[1em] w-[1em] align-[-0.125em] [&_svg]:block [&_svg]:h-full [&_svg]:w-full [&_svg]:fill-current [&_svg_.st0]:fill-current",
42-
// Bitmap icons (embedded PNGs) need CSS filters to match the monochrome style
43-
isBitmap && "grayscale brightness-[2] dark:brightness-[10] dark:contrast-[0.5]",
41+
"inline-block h-[1em] w-[1em] align-[-0.125em] [&_svg]:block [&_svg]:h-full [&_svg]:w-full",
42+
// Stroke-based icons (like GatewayIcon) use stroke for color, others use fill
43+
isStrokeBased
44+
? "[&_svg]:stroke-current [&_svg]:fill-none"
45+
: "[&_svg]:fill-current [&_svg_.st0]:fill-current",
4446
props.className
4547
)}
4648
>

0 commit comments

Comments
 (0)