fix: double declaration of iconName
This commit is contained in:
parent
3be4e63d71
commit
d2fa72c13e
@ -116,6 +116,25 @@ export default function ResolvedIcon({ icon, width = 32, height = 32, alt = "log
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (icon.endsWith(".webp")) {
|
||||||
|
const iconName = icon.replace(".webp", "");
|
||||||
|
return (
|
||||||
|
<Image
|
||||||
|
src={`https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/webp/${iconName}.webp`}
|
||||||
|
width={width}
|
||||||
|
height={height}
|
||||||
|
style={{
|
||||||
|
width,
|
||||||
|
height,
|
||||||
|
objectFit: "contain",
|
||||||
|
maxHeight: "100%",
|
||||||
|
maxWidth: "100%",
|
||||||
|
}}
|
||||||
|
alt={alt}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const iconName = icon.replace(".png", "");
|
const iconName = icon.replace(".png", "");
|
||||||
return (
|
return (
|
||||||
<Image
|
<Image
|
||||||
@ -132,21 +151,4 @@ export default function ResolvedIcon({ icon, width = 32, height = 32, alt = "log
|
|||||||
alt={alt}
|
alt={alt}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
const iconName = icon.replace(".webp", "");
|
|
||||||
return (
|
|
||||||
<Image
|
|
||||||
src={`https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/webp/${iconName}.webp`}
|
|
||||||
width={width}
|
|
||||||
height={height}
|
|
||||||
style={{
|
|
||||||
width,
|
|
||||||
height,
|
|
||||||
objectFit: "contain",
|
|
||||||
maxHeight: "100%",
|
|
||||||
maxWidth: "100%",
|
|
||||||
}}
|
|
||||||
alt={alt}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user