-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Badge refractor #1545
Badge refractor #1545
Conversation
c06cbb5
to
314f2ed
Compare
Codecov Report
@@ Coverage Diff @@
## next #1545 +/- ##
==========================================
- Coverage 75.72% 75.64% -0.08%
==========================================
Files 33 33
Lines 618 616 -2
Branches 86 82 -4
==========================================
- Hits 468 466 -2
Misses 129 129
Partials 21 21
Continue to review full report at Codecov.
|
Badges when they have a few characters are circuclar. As the value is longer, they'll keep the same height and grow horizontally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* commit '0126436f5f0f37e0340b0c1da32bdea5605cb6df': (43 commits) feat(Card): Remove flexDirection prop feat(Card): Remove fontFamily prop test: Add tests for withTheme test: Fix searcbar error being logged to console fix: Hoist statics for withTheme hoc (react-native-elements#1554) fix: Use library for calculating statusBar height (react-native-elements#1553) ref: Badge component (react-native-elements#1545) Set default prop for type (react-native-elements#1546) docs: Fix paragraphs links in docs (react-native-elements#1536) docs(website): Make image preview section reusable feat: Add button types (react-native-elements#1540) fix: Rounded buttons on android now work correctly (react-native-elements#1538) ci: Run travis against node stable fix: Make button height consistent when using loading ci: Update husky and lint-staged feat: Add AntDesign to list of available icon sets (react-native-elements#1529) docs(website): Add central place to show supported icon sets (react-native-elements#1532) feat(Input): Allow label to be a React element (react-native-elements#1531) ci: Remove expo ci from PRs (react-native-elements#1528) fix(Button): Make the padding consistent (react-native-elements#1505) ...
Badge sizes were much too big compared to actual badges in apps. This commit more realigns with the sizes before the badge refractor in #1545.
Motivation
The Badge is a component that doesn't get as much use as it could. This PR aims to make the badge more useful as well as highlighting use cases where it may be good to use a badge.
BREAKING CHANGES
wrapperStyle
has been removed. Was kind of pointless and misleading since we don't use the term wrapper anywhere in other components.containerStyle
now functions as what waswrapperStyle
and a new propbadgeStyle
replaces what wascontainerStyle
in a similar fashion to theButton
component.element
prop which was undocumented was removed. Just use thevalue
propvalue
prop which now supports rendering react components (thanks torenderNode
helper).Features
value
is provided.status
prop which is a convenience prop for styling the background viabadgeStyle
for quick and commonly used scenariosAPI
Screenshots