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

feat(component): restrict badges to use label props and style fixes #339

Merged
merged 1 commit into from
Feb 14, 2020

Conversation

chanceaclark
Copy link
Contributor

What

  • Restrict Badge component to use label prop.
  • Fix styling inconsistencies:
    • line-height grew inside Text component
    • extra 1px space on top

@chanceaclark chanceaclark requested a review from a team February 14, 2020 19:47
BREAKING CHANGE:
Convert `<Badge>label</Badge>` to `<Badge label="label" />`.
@chanceaclark chanceaclark merged commit a8af2f2 into bigcommerce:master Feb 14, 2020
@chanceaclark chanceaclark deleted the feat/badge branch February 14, 2020 20:49
variant?: 'danger' | 'secondary' | 'success' | 'warning';
}

export const Badge: React.FC<BadgeProps> = memo(({ className, style, ...props }) => <StyledBadge {...props} />);
export const Badge: React.FC<BadgeProps> = memo(({ className, style, label, ...props }) => (
<StyledBadge {...props}>{label}</StyledBadge>
Copy link
Member

Choose a reason for hiding this comment

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

What do you think about doing a type check for the label? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that's wise.

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

Successfully merging this pull request may close these issues.

3 participants