Skip to content

Commit

Permalink
fix: 🚑 filter out cloned icons from README preview pngs
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-labs committed May 5, 2024
1 parent 636503c commit f5edca0
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/scripts/preview/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,29 @@ const filterDuplicates = (icons: string[]) => {

const basicFileIcons = filterDuplicates(
fileIcons.icons
.map((i) => `${i.name}${i.clone ? '.clone' : ''}`)
// remove icons that are clones
.filter((i) => i.clone === undefined)
.map((i) => i.name)
// merge language icons
.concat(languageIcons.map((i) => i.icon.name))
).map((i) => ({ iconName: i, label: i.replace('.clone', '') }));
).map((i) => ({ iconName: i, label: i }));

const folderThemes = filterDuplicates(
folderIcons
.map((theme) => {
const folders = [];
if (theme.icons && theme.icons.length > 0) {
folders.push(
...theme.icons.map((i) => `${i.name}${i.clone ? '.clone' : ''}`)
...theme.icons
// remove icons that are clones
.filter((i) => i.clone === undefined)
.map((i) => i.name)
);
}
return [...folders];
})
.reduce((a, b) => a.concat(b))
).map((i) => ({
iconName: i,
label: i.replace('folder-', '').replace('.clone', ''),
}));
).map((i) => ({ iconName: i, label: i.replace('folder-', '') }));

generatePreview('fileIcons', basicFileIcons, 5, [
'virtual',
Expand Down

0 comments on commit f5edca0

Please sign in to comment.