mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-08 14:38:47 +00:00
add support for dashboard-icons svg format
This commit is contained in:
parent
7d877fb8e0
commit
ccbe11e20c
1 changed files with 20 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue