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

fix(Icon): Support intellisense for type= prop #373

Merged
merged 2 commits into from
Oct 13, 2021

Conversation

stephenmathieson
Copy link
Member

This patch adds a build step which dynamically creates our list of <Icon> types. This enables intellisense and prevents us from having to manually edit the demo page.

Closes #281

This patch adds a build step which dynamically creates our list of `<Icon>` types. This enables intellisense and prevents us from having to manually edit the demo page.

Closes #281
@stephenmathieson stephenmathieson requested a review from a team October 13, 2021 19:29
Comment on lines +14 to +21
const ICONS_WITH_DIRECTIONS = [
'arrow',
'arrow-circle',
'chevron',
'chevron-double',
'triangle'
];
const DIRECTIONS = ['up', 'down', 'left', 'right'];
Copy link
Member

Choose a reason for hiding this comment

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

In theory, any icon could have a direction since it's just a modifier. I don't have strong opinions here since these are all the icons that make sense to have directions, we would just need to remember to add them when adding new icons. 🤷

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't like that we'll have to remember to add them here either. The only other option (which you've alluded to) is allowing direction modifiers on all icons. Not sure it makes sense to do type="pencil-down' though 🤷

Happy to do whatever y'all think is best here.

Copy link
Member

Choose a reason for hiding this comment

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

I don't think it's worth holding up the PR over, so I'm going to approve and then see if @schne324 objects.

* develop:
  feat: Add recycle and info square icons (#374)
  chore: Remove unused `package-lock.json` file (#372)
@stephenmathieson stephenmathieson merged commit 6f86a1b into develop Oct 13, 2021
@stephenmathieson stephenmathieson deleted the fix-icon-type branch October 13, 2021 22:10
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.

Icon's type= prop is deceiving
3 participants