mirror of https://github.com/kortix-ai/suna.git
Merge pull request #894 from KrishavRajSingh/krishav/fix_icon_darkmode
Fix icon theme if theme is system
This commit is contained in:
commit
e04d53242d
|
@ -8,7 +8,7 @@ interface KortixLogoProps {
|
|||
size?: number;
|
||||
}
|
||||
export function KortixLogo({ size = 24 }: KortixLogoProps) {
|
||||
const { theme } = useTheme();
|
||||
const { theme, systemTheme } = useTheme();
|
||||
const [mounted, setMounted] = useState(false);
|
||||
|
||||
// After mount, we can access the theme
|
||||
|
@ -16,13 +16,17 @@ export function KortixLogo({ size = 24 }: KortixLogoProps) {
|
|||
setMounted(true);
|
||||
}, []);
|
||||
|
||||
const shouldInvert = mounted && (
|
||||
theme === 'dark' || (theme === 'system' && systemTheme === 'dark')
|
||||
);
|
||||
|
||||
return (
|
||||
<Image
|
||||
src="/kortix-symbol.svg"
|
||||
alt="Kortix"
|
||||
width={size}
|
||||
height={size}
|
||||
className={`${mounted && theme === 'dark' ? 'invert' : ''} flex-shrink-0`}
|
||||
className={`${shouldInvert ? 'invert' : ''} flex-shrink-0`}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue