Skip to content

Commit

Permalink
Merge pull request #233 from nburka/also-fix-duplication-component-na…
Browse files Browse the repository at this point in the history
…mes-on-display

pull the correct meta data when a component name exists in two categories
  • Loading branch information
nburka authored Nov 23, 2024
2 parents ff1add2 + 104ef68 commit a225e28
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ async function getIcons(dirName: string): Promise<Icon[]> {
fileNames.map(async (fileName) => {
const id = fileName.replace(/\.[^/.]+$/, '');

const currentFileMetaData = metaData.find((m) => m.id === id);
// find same icon id in the same category from the meta-data JSON file
const currentFileMetaData = metaData.find(
(m) => m.id === id && m.category === dirName
);

return {
title: currentFileMetaData?.title || id,
Expand Down

0 comments on commit a225e28

Please sign in to comment.