Skip to content

Commit

Permalink
fix(IconLibrary): fix issue with glyph only icons
Browse files Browse the repository at this point in the history
  • Loading branch information
tw15egan committed Jul 28, 2021
1 parent 3b33c72 commit bb40847
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/SVGLibraries/IconLibrary/IconLibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,16 @@ const IconLibrary = () => {

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

const glyphOnly = icon.sizes.length === 1 && icon.sizes[0] === 'glyph';

return [
...accumulator,
{
...icon,
Component: loadable(() =>
import(`@carbon/icons-react/lib/${path}/32`)
import(
`@carbon/icons-react/lib/${path}/${glyphOnly ? 'index' : '32'}`
)
),
},
];
Expand Down

0 comments on commit bb40847

Please sign in to comment.