Skip to content

Commit

Permalink
fix: lazy loading icons name
Browse files Browse the repository at this point in the history
  • Loading branch information
rivka-ungar committed Nov 7, 2024
1 parent 3cc2252 commit 3f89f29
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion packages/icons/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @vibe/icons

This package includes all of the icons of monday.com's [Vibe Design System](https://vibe.monday.com/?path=/story/media-icon--icons-list-story), available as React components and raw SVGs for flexible usage in your projects.
This package includes all of the icons of monday.com's [Vibe Design System](https://vibe.monday.com/?path=/story/media-icon--icons-list-story), available as React components and raw SVGs and with lazy loading support for optimized performance and flexible usage in your projects.


## Installation
Expand All @@ -19,6 +19,12 @@ npm install @vibe/icons
import { Close } from "@vibe/icons";
```

#### Using Lazy React Components

```javascript
import { Close } from "@vibe/icons/lazy";
```

#### Using Raw SVG Files

```javascript
Expand Down
2 changes: 1 addition & 1 deletion packages/icons/scripts/generate-lazy-icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default ${fileNameWithoutExtension};
const indexContent = iconFiles
.map(file => {
const fileNameWithoutExtension = path.basename(file, ".tsx");
return `export { default as Lazy${fileNameWithoutExtension}Icon } from './${fileNameWithoutExtension}';`;
return `export { default as ${fileNameWithoutExtension} } from './${fileNameWithoutExtension}';`;
})
.join("\n");

Expand Down

0 comments on commit 3f89f29

Please sign in to comment.