Badge refractor - #1545
Merged
Merged
Conversation
iRoachie
force-pushed
the
badge-upgrade
branch
from
November 1, 2018 16:23
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.
xavier-villelegier
approved these changes
Nov 3, 2018
nurdiansyah
added a commit
to deboxlibrary/react-native-elements
that referenced
this pull request
Nov 6, 2018
* 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) ...
iRoachie
added a commit
that referenced
this pull request
Dec 9, 2018
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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
wrapperStylehas been removed. Was kind of pointless and misleading since we don't use the term wrapper anywhere in other components.containerStylenow functions as what waswrapperStyleand a new propbadgeStylereplaces what wascontainerStylein a similar fashion to theButtoncomponent.elementprop which was undocumented was removed. Just use thevaluepropvalueprop which now supports rendering react components (thanks torenderNodehelper).Features
valueis provided.statusprop which is a convenience prop for styling the background viabadgeStylefor quick and commonly used scenariosAPI
Screenshots