Skip to content

Commit

Permalink
Fix icon
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Naszalyi committed Nov 20, 2024
1 parent 52b098a commit e6374cd
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions packages/react/components/icon/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import { getColorClassName, TrilogyColor, TrilogyColorValues } from '@/objects/f
import { hashClass } from '@/helpers'
import { useTrilogyContext } from '@/context'
import { getBackgroundClassName } from '@/objects/atoms/Background'
import { IconStatus } from '@/components/icon/IconEnum'
import { getStatusBackground, has, is } from '@/services'
import { has, is } from '@/services'

/**
* Icon Component
Expand All @@ -27,23 +26,22 @@ import { getStatusBackground, has, is } from '@/services'
*/

const Icon = ({
className,
id,
size,
name,
circled,
stretched,
color,
backgroundColor,
onClick,
skeleton,
...others
}: IconProps): JSX.Element => {
className,
id,
size,
name,
circled,
stretched,
color,
backgroundColor,
onClick,
skeleton,
...others
}: IconProps): JSX.Element => {
const { styled } = useTrilogyContext()

const background =
(backgroundColor && has(getBackgroundClassName(backgroundColor))) ||
(status && getStatusBackground(status, IconStatus.INFO)) ||
(circled && has(getBackgroundClassName(TrilogyColor.MAIN))) ||
''

Expand All @@ -64,7 +62,7 @@ const Icon = ({

return (
<span id={id} onClick={onClick && onClick} className={classes} {...others}>
<i className={hashClass(styled, clsx(name))} aria-hidden='true' />
<i className={hashClass(styled, clsx(name))} aria-hidden="true" />
</span>
)
}
Expand Down

0 comments on commit e6374cd

Please sign in to comment.