Skip to content

Added Badge component.#2045

Merged
oliviertassinari merged 1 commit intomui:masterfrom
rhythnic:master
Nov 9, 2015
Merged

Added Badge component.#2045
oliviertassinari merged 1 commit intomui:masterfrom
rhythnic:master

Conversation

@rhythnic
Copy link

@rhythnic rhythnic commented Nov 3, 2015

The badge is for displaying a small number or piece of text to the top-right of it's child. It's mostly useful for displaying a counter.
See Material Design Light's Badge.

@oliviertassinari
Copy link
Member

Sounds like a good component!

src/badge.jsx Outdated
Copy link
Member

Choose a reason for hiding this comment

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

You should be able to remove prefix. Our auto prefixed tool should do it for us.

Copy link
Author

Choose a reason for hiding this comment

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

37cbc1d

I wasn't sure if the prefixer covers similar properties or just prefixed properties with the same name, so I've left in the prefixed similar properties for now.

@rhythnic
Copy link
Author

rhythnic commented Nov 4, 2015

@oliviertassinari thanks for the good feedback.

src/badge.jsx Outdated
Copy link
Member

Choose a reason for hiding this comment

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

Can't we create a local theme variable instead of the 6 call of getTheme()?

Copy link
Author

Choose a reason for hiding this comment

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

getTheme() will only be invoked once or twice, so it might be more efficient not to store an unnecessary variable, but if you want to do it that way for legibility it's fine with me.

Copy link
Author

Choose a reason for hiding this comment

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

Actually, you're right. The getTheme method is not necessary. I was basing the code off of another component in order to help me get started, but that method not necessary here.

Copy link
Author

Choose a reason for hiding this comment

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

@oliviertassinari
Copy link
Member

@rhythnic I have done my final feedbacks. Could you have a look at them? Once you are happy with it, can you squash down the number of commit (will keep the history clean) and I will probably merge 👍 .

src/badge.jsx Outdated
Copy link
Member

Choose a reason for hiding this comment

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

Can't we remove this?

Copy link
Author

Choose a reason for hiding this comment

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

@oliviertassinari
Copy link
Member

@rhythnic Looks good to me now 👍.
Could you squash down the commit to the most significant ones? (to keep the history clean)
I will merge then, unless @shaurya947 has any feedbacks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: badge Changes related to the badge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants