Update resolvedicon.jsx - test for custom color suffix
Changed if condition from string.match to string.test and expanded regex to also include upper case letters.
This commit is contained in:
parent
9a71c4de12
commit
8bdedfa4f7
@ -38,7 +38,7 @@ export default function ResolvedIcon({ icon, width = 32, height = 32, alt = "log
|
|||||||
|
|
||||||
if (prefix in iconSetURLs) {
|
if (prefix in iconSetURLs) {
|
||||||
// check whether icon ends with color code
|
// check whether icon ends with color code
|
||||||
if (!(suffix.match(`[#][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]`) == null)) {
|
if (suffix.test(`[#][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9]`)) {
|
||||||
|
|
||||||
const iconColor = `${suffix}`;
|
const iconColor = `${suffix}`;
|
||||||
const iconName = icon.replace(`${prefix}-`, "").replace(".svg", "").replace(`-${suffix}`, "");
|
const iconName = icon.replace(`${prefix}-`, "").replace(".svg", "").replace(`-${suffix}`, "");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user