Skip to content

Commit

Permalink
Add rotation
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Neuteboom committed Jun 21, 2024
1 parent 4d2a7f8 commit 11560e1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,20 @@ export type IconAppearanceProps = {
color?: string
size?: number
testID?: string
rotation?: number
}

export type IconProps = IconAppearanceProps & {
name: IconName
}

export const Icon = ({ name, color, size, testID, style }: IconProps): JSX.Element => {
export const Icon = ({ name, color, size, testID, style, rotation }: IconProps): JSX.Element => {
const iconStyle = style ?? 'light'
const icon = iconStyle === 'light' ? Icons[name].light : Icons[name].solid
const iconColor = color ?? theme.color.primary
const iconSize = size ?? theme.icon.size.large

return <FontAwesomeIcon icon={icon} color={iconColor} size={iconSize} testID={testID} />
return (
<FontAwesomeIcon icon={icon} color={iconColor} size={iconSize} testID={testID} transform={{ rotate: rotation }} />
)
}

0 comments on commit 11560e1

Please sign in to comment.