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

Icon component #205

Merged
merged 4 commits into from
Mar 24, 2016
Merged

Icon component #205

merged 4 commits into from
Mar 24, 2016

Conversation

levithomason
Copy link
Member

Closes #178 includes docs. Replaces all <i /> with <Icon /> and updates classes.


image

'icon',
)
return (
<i {...this.props} className={classes} />
Copy link
Member

Choose a reason for hiding this comment

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

One thing I've seen with a lot of <Icon /> components is the usage of props for icon type rather than classes, that way it's not just a no-value-added wrapper over an <i> element. It also makes it quicker (read: less code) to create them (compare <Icon heart /> vs. <Icon className='heart' />)

Food for thought.

Copy link
Member Author

Choose a reason for hiding this comment

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

Absolutely, we're going to move all Semantic UI class names into props once all components are done. Like so:

<Icon user />
<Grid centerAligned padded />

@levithomason levithomason merged commit c9b8de8 into master Mar 24, 2016
@levithomason levithomason deleted the feature/icon branch March 24, 2016 05:56
@levithomason
Copy link
Member Author

Went to do this then pushed it back again. Wanted to get some perspective though. How would you add a on click callback then? Do we parse props and only turn boolean props into classes? Spreading the rest?

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