Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
MonPote committed Jun 19, 2023
1 parent f04dfaf commit 26f0c84
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions src/lib/components/icon/Icon.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,36 +162,6 @@ const DelayedFallback = ({
return <i {...rest}>{show && children}</i>;
};

function getLazyStyledIcon(iconInfo: string) {
const [iconType, iconClass] = iconInfo.split(' ');
return React.lazy(async () => {
try {
const fontAwesomeType =
iconType === 'far' ? 'free-regular-svg-icons' : 'free-solid-svg-icons';
const icon = await import(
`@fortawesome/${fontAwesomeType}/${iconClass}.js`
);
return {
default: ({ name, color, size, ariaLabel, ...rest }) => (
<IconStyled
color={color}
icon={icon[iconClass]}
size={size}
aria-label={`${name} ${ariaLabel}`}
{...rest}
/>
),
};
} catch {
return {
default: ({ name, ariaLabel }) => (
<Loader size="base" aria-label={`${name} ${ariaLabel}`} />
),
};
}
});
}

export const IconWrapper = styled.div<{ size: SizeProp }>`
${(props) => {
const brand = getTheme(props);
Expand Down

0 comments on commit 26f0c84

Please sign in to comment.