fix: make models.dev provider logos theme-aware (#19225)

closes
https://discord.com/channels/1130383047699738754/1486675857245212682
This commit is contained in:
nitin
2026-04-02 16:40:30 +05:30
committed by GitHub
parent 223943550c
commit c854d28d60
@@ -1,5 +1,7 @@
import { styled } from '@linaria/react';
import { useContext } from 'react';
import { type IconComponentProps } from 'twenty-ui/display';
import { ThemeContext } from 'twenty-ui/theme-constants';
type ModelsDevProviderLogoProps = {
logoUrl: string;
@@ -30,7 +32,9 @@ export const ModelsDevProviderLogo = ({
className,
style,
}: ModelsDevProviderLogoProps) => {
const { theme } = useContext(ThemeContext);
const pixelSize = resolvePixelSize(size);
const isLightTheme = theme.name === 'light';
return (
<StyledLogo
@@ -38,7 +42,10 @@ export const ModelsDevProviderLogo = ({
className={className}
height={pixelSize}
src={logoUrl}
style={style}
style={{
...style,
filter: isLightTheme ? 'none' : 'invert(1)',
}}
width={pixelSize}
/>
);