Skip to content

Feat/support customElement in Badge #1153

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

Merged
merged 3 commits into from
Jan 27, 2021

Conversation

lidord-wix
Copy link
Contributor

Description

Support passing custom element to Badge component.
Add examples to the Badge example screen.

Changelog

Support passing custom element to Badge component.

Comment on lines 248 to 249
!customElement &&
icon && (
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think the icon should depend on customElement..
The user should decide what they want to pass.

@@ -230,38 +236,35 @@ class Badge extends PureComponent<BadgeProps> {
}
}

renderCustomElement() {
const {customElement} = this.props;
return customElement && <View>{customElement}</View>;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is wrapping the customElement with a View necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope.. fixed :)

@lidord-wix lidord-wix requested a review from ethanshar January 27, 2021 08:21
@ethanshar ethanshar merged commit e4fee56 into master Jan 27, 2021
@lidord-wix lidord-wix deleted the feat/support_customElement_in_Badge branch February 23, 2021 12:01
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