Update resolvedicon.jsx

Remove unnecessary variable, restoring the fallback code in case no custom icon color is provided.
This commit is contained in:
Mega-Volti 2023-07-25 15:57:38 +02:00 committed by GitHub
parent 5264ffd071
commit 9a71c4de12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,10 +57,8 @@ export default function ResolvedIcon({ icon, width = 32, height = 32, alt = "log
/> />
); );
}; };
// default to theme setting if no custom icon color code is provided // default to theme setting if no custom icon color code is provided
const iconColor = settings.iconStyle === "theme" ?
`rgb(var(--color-${ theme === "dark" ? 300 : 900 }) / var(--tw-text-opacity, 1))` :
"linear-gradient(180deg, rgb(var(--color-logo-start)), rgb(var(--color-logo-stop)))";
const iconName = icon.replace(`${prefix}-`, "").replace(".svg", ""); const iconName = icon.replace(`${prefix}-`, "").replace(".svg", "");
const iconSource = `${iconSetURLs[prefix]}${iconName}.svg`; const iconSource = `${iconSetURLs[prefix]}${iconName}.svg`;
return ( return (
@ -70,7 +68,9 @@ export default function ResolvedIcon({ icon, width = 32, height = 32, alt = "log
height, height,
maxWidth: '100%', maxWidth: '100%',
maxHeight: '100%', maxHeight: '100%',
background: `${iconColor}`, background: settings.iconStyle === "theme" ?
`rgb(var(--color-${ theme === "dark" ? 300 : 900 }) / var(--tw-text-opacity, 1))` :
"linear-gradient(180deg, rgb(var(--color-logo-start)), rgb(var(--color-logo-stop)))",
mask: `url(${iconSource}) no-repeat center / contain`, mask: `url(${iconSource}) no-repeat center / contain`,
WebkitMask: `url(${iconSource}) no-repeat center / contain`, WebkitMask: `url(${iconSource}) no-repeat center / contain`,
}} }}