From 5080301efe7758d94e3edbdb91b2c9f5fa99f50b Mon Sep 17 00:00:00 2001 From: Erv Walter Date: Sun, 23 Apr 2023 16:12:08 +0000 Subject: [PATCH] force icons to fit withing a 32x32 square --- src/components/resolvedicon.jsx | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/components/resolvedicon.jsx b/src/components/resolvedicon.jsx index 8657a754b..d503fe9d8 100644 --- a/src/components/resolvedicon.jsx +++ b/src/components/resolvedicon.jsx @@ -3,7 +3,19 @@ import Image from "next/future/image"; export default function ResolvedIcon({ icon, width = 32, height = 32, alt = "logo" }) { // direct or relative URLs if (icon.startsWith("http") || icon.startsWith("/")) { - return {alt}; + return ( + {alt} + ); } // mdi- prefixed, material design icons @@ -31,6 +43,11 @@ export default function ResolvedIcon({ icon, width = 32, height = 32, alt = "log src={`https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons/png/${iconName}.png`} width={width} height={height} + style={{ + width, + height, + objectFit: "contain", + }} alt={alt} /> );