Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BrandIcon component #60

Merged
merged 3 commits into from
Jan 7, 2025
Merged

Conversation

jonathan-waarneming-nl
Copy link
Collaborator

Copy link
Member

@SjaakSchilperoort SjaakSchilperoort left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Geen ophoging van de versie in package.json?

const iconColor = color ?? theme.color.primary
const iconSize = size ?? theme.icon.size.large

return <FontAwesomeIcon icon={icon as IconProp} color={iconColor} size={iconSize} />
Copy link
Member

@SjaakSchilperoort SjaakSchilperoort Jan 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Die narrowing as IconProp is verdacht, want de types IconDefinition en IconProp hebben geen expliciete overlap. Als je icon op deze manier definieert dan heb je geen as IconProp nodig:

  const { prefix, iconName } = BrandIcons[name]
  const icon = { prefix, iconName } as IconLookup

(disclaimer: heb niet getest of dit nog steeds goed werkt).

EDIT Weet niet of dit een goede oplossing is, want dit zou ook moeten werken const icon: IconLookup = { prefix, iconName } maar geeft nog steeds typing errors.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot to the rescue: het was een versieverschil

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! Toch goed gevonden 😉

Copy link
Member

@SjaakSchilperoort SjaakSchilperoort left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fijn 👌🏻

@jonathan-waarneming-nl jonathan-waarneming-nl merged commit 5312fd1 into develop Jan 7, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants