Skip to content

Commit

Permalink
pull the correct meta data when a component name exists in two catego…
Browse files Browse the repository at this point in the history
…ries
  • Loading branch information
nburka committed Nov 23, 2024
1 parent ff1add2 commit 104ef68
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 104ef68

Please sign in to comment.