Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { createElement } from "preact";
type IconSetItem = {
properties: {
name: string;
iconSetName?: string;
};
icon: {
paths: string[];
Expand All @@ -17,6 +18,7 @@ type IconSet = {

export interface IconProps extends SVGElement {
icon: string;
iconSetName?: string;
size?: string | number;
title?: string;
disableFill?: boolean;
Expand All @@ -30,6 +32,7 @@ interface IcoMoonProps extends IconProps {
const IcoMoon = ({
iconSet,
icon,
iconSetName,
size,
title,
disableFill,
Expand All @@ -39,7 +42,9 @@ const IcoMoon = ({
if (!iconSet || !icon) return null;

const currentIcon = iconSet.icons.find(
(item) => item.properties.name === icon
(item) =>
item.properties.name === icon &&
(iconSetName ? item.properties.iconSetName === iconSetName : true)
);

if (!currentIcon) return null;
Expand Down