Skip to content

Commit

Permalink
fix(IconLibrary): fix issue with glyph only icons (#2457)
Browse files Browse the repository at this point in the history
* fix(IconLibrary): fix issue with glyph only icons

* fix(IconLibrary): change path

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
tw15egan and kodiakhq[bot] committed Jul 29, 2021
1 parent 16a77a4 commit a5134d8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dev": "gatsby develop -H 0.0.0.0",
"dev:clean": "gatsby clean && yarn dev",
"clean": "gatsby clean",
"build": "node --max-old-space-size=4096 ./node_modules/.bin/gatsby build",
"build": "node --max-old-space-size=8192 ./node_modules/.bin/gatsby build",
"build:clean": "gatsby clean && yarn build",
"build:analyze": "yarn install --force && yarn clean && ANALYZE=true yarn build",
"serve": "gatsby serve",
Expand Down
11 changes: 11 additions & 0 deletions src/components/SVGLibraries/IconLibrary/IconLibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@ const IconLibrary = () => {

const path = [...icon.namespace, icon.name].join('/');

if (icon.sizes.length === 1 && icon.sizes[0] === 'glyph') {
return [
...accumulator,
{
...icon,
Component: loadable(() =>
import(`@carbon/icons-react/lib/${path}/index`)
),
},
];
}
return [
...accumulator,
{
Expand Down

1 comment on commit a5134d8

@vercel
Copy link

@vercel vercel bot commented on a5134d8 Jul 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.