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

Add label for the Input component #990

Merged
merged 8 commits into from
Apr 1, 2018
Merged

Add label for the Input component #990

merged 8 commits into from
Apr 1, 2018

Conversation

xavier-villelegier
Copy link
Collaborator

@xavier-villelegier xavier-villelegier commented Mar 12, 2018

Refs #892
Associated PR for the example app: react-native-elements/react-native-elements-app#48

Props changes

  • label adds a label on top of the Input
  • labelStyle adds style to the label
  • Remove useless displayError props. If the errorMessage is not null, I suppose there is an error to display…

I basically took back the style of the old FormLabel

Result

simulator screen shot - iphone x - 2018-03-12 at 23 26 28

@codecov
Copy link

codecov bot commented Mar 12, 2018

Codecov Report

Merging #990 into next will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             next     #990   +/-   ##
=======================================
  Coverage   54.36%   54.36%           
=======================================
  Files          34       34           
  Lines         607      607           
  Branches      112      112           
=======================================
  Hits          330      330           
  Misses        220      220           
  Partials       57       57
Impacted Files Coverage Δ
src/input/Input.js 18.75% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ca5823f...729a0a9. Read the comment docs.

label != null &&
<Text style={[styles.label, labelStyle]}>
{label}
</Text>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should be the same as label && element not so? Any reason why explicitly checking for null?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yea I was thinking about the case where label is an empty string, but I can't think about any use case for that

@@ -101,9 +111,9 @@ class Input extends Component {
</View>
)}
</Animated.View>
{displayError && (
{errorMessage != null && (
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as above

@react-native-elements-ci
Copy link
Collaborator

react-native-elements-ci commented Apr 1, 2018

@iRoachie iRoachie merged commit 4c99586 into next Apr 1, 2018
@xavier-villelegier xavier-villelegier deleted the input-label branch April 1, 2018 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants