Skip to content

Commit

Permalink
Merge pull request #1014 from ZopaPublic/fix-icon-error
Browse files Browse the repository at this point in the history
fix(icon): pass a string rather than undefined to the font awesome co…
  • Loading branch information
moshie committed May 17, 2024
2 parents 391bc5f + f4de3e8 commit 277b86d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/fuzzy-poets-carry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@zopauk/react-components': patch
---

fix icon component passing undefined classname to font awesome
4 changes: 2 additions & 2 deletions src/components/atoms/Icon/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ export const RoundBadge = styled.div<{ color: Colors[keyof Colors] }>`
padding: ${spacing[6]};
`;

export default function Icon({ variant, bgColor, ariaLabel, className, ...rest }: IconProps) {
export default function Icon({ variant, bgColor, ariaLabel, className = '', ...rest }: IconProps) {
const renderIcon = (className?: string) => (
<FontAwesomeIcon
{...rest}
icon={variant}
className={className}
className={className || ''}
aria-label={ariaLabel}
aria-hidden={ariaLabel ? false : true}
/>
Expand Down

0 comments on commit 277b86d

Please sign in to comment.