mirror of
https://github.com/karl0ss/homepage.git
synced 2025-04-29 12:03:41 +01:00
Merge pull request #1485 from flor0/main
Add support for dashboard-icons SVG file format
This commit is contained in:
commit
6324c895ea
@ -57,7 +57,27 @@ export default function ResolvedIcon({ icon, width = 32, height = 32, alt = "log
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// fallback to dashboard-icons
|
||||
if (icon.endsWith(".svg")) {
|
||||
const iconName = icon.replace(".svg", "");
|
||||
return (
|
||||
<Image
|
||||
src={`https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons/svg/${iconName}.svg`}
|
||||
width={width}
|
||||
height={height}
|
||||
style={{
|
||||
width,
|
||||
height,
|
||||
objectFit: "contain",
|
||||
maxHeight: "100%",
|
||||
maxWidth: "100%"
|
||||
}}
|
||||
alt={alt}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
const iconName = icon.replace(".png", "");
|
||||
return (
|
||||
<Image
|
||||
|
Loading…
x
Reference in New Issue
Block a user