Merge pull request #817 from Jose134/bookmark-fix-814

pull/776/head^2
shamoon 2 years ago committed by GitHub
commit 59bec6e65e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -19,7 +19,7 @@ export default function Item({ bookmark }) {
<div className="flex-shrink-0 flex items-center justify-center w-11 bg-theme-500/10 dark:bg-theme-900/50 text-theme-700 hover:text-theme-700 dark:text-theme-200 text-sm font-medium rounded-l-md"> <div className="flex-shrink-0 flex items-center justify-center w-11 bg-theme-500/10 dark:bg-theme-900/50 text-theme-700 hover:text-theme-700 dark:text-theme-200 text-sm font-medium rounded-l-md">
{bookmark.icon && {bookmark.icon &&
<div className="flex-shrink-0 w-5 h-5"> <div className="flex-shrink-0 w-5 h-5">
<ResolvedIcon icon={bookmark.icon} /> <ResolvedIcon icon={bookmark.icon} alt={bookmark.abbr} />
</div> </div>
} }
{!bookmark.icon && bookmark.abbr} {!bookmark.icon && bookmark.abbr}

@ -1,9 +1,9 @@
import Image from "next/future/image"; import Image from "next/future/image";
export default function ResolvedIcon({ icon, width = 32, height = 32 }) { export default function ResolvedIcon({ icon, width = 32, height = 32, alt = "logo" }) {
// direct or relative URLs // direct or relative URLs
if (icon.startsWith("http") || icon.startsWith("/")) { if (icon.startsWith("http") || icon.startsWith("/")) {
return <Image src={`${icon}`} width={width} height={height} alt="logo" />; return <Image src={`${icon}`} width={width} height={height} alt={alt} />;
} }
// mdi- prefixed, material design icons // mdi- prefixed, material design icons
@ -31,7 +31,7 @@ export default function ResolvedIcon({ icon, width = 32, height = 32 }) {
src={`https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons/png/${iconName}.png`} src={`https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons/png/${iconName}.png`}
width={width} width={width}
height={height} height={height}
alt="logo" alt={alt}
/> />
); );
} }
Loading…
Cancel
Save