-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
There was a problem hiding this 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
?
src/components/BrandIcon.tsx
Outdated
const iconColor = color ?? theme.color.primary | ||
const iconSize = size ?? theme.icon.size.large | ||
|
||
return <FontAwesomeIcon icon={icon as IconProp} color={iconColor} size={iconSize} /> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! Toch goed gevonden 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fijn 👌🏻
Part of: https://github.com/observation/obsidentify/pull/990