Update resolvedicon.jsx - upper case color hex codes

Update regular expression to also allow for upper case letters as part of the hex color code, as either are valid when describing an objects color.
This commit is contained in:
Mega-Volti 2023-07-25 19:29:51 +02:00 committed by GitHub
parent 185a4cbae5
commit b7ea220118
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,7 +41,7 @@ export default function ResolvedIcon({ icon, width = 32, height = 32, alt = "log
let iconColor;
const suffix = icon.split("-")[icon.split("-").length - 1];
if (!(suffix.match(`[#][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]`) == null)) {
if (!(suffix.match(`[#][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9]`) == null)) {
// set custom color code
iconName = icon.replace(`${prefix}-`, "").replace(".svg", "").replace(`-${suffix}`, "");
iconColor = `${suffix}`;