-
Notifications
You must be signed in to change notification settings - Fork 26
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 NumberField #74
Add NumberField #74
Conversation
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.
Looks good. I like the extraction to the FieldErrors
now that we need it.
placeholder={this.props.placeholder} | ||
horizontalConstraint="scale" | ||
{...filterDataAttributes(this.props)} | ||
/> | ||
{this.renderErrors()} | ||
<FieldErrors |
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.
Ah now I get the read.
import ErrorMessage from '../messages/error-message'; | ||
import messages from './messages'; | ||
|
||
const isObject = obj => typeof obj === 'object'; |
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.
Feels like this could as well be const hasErrors = errors => typeof errors !== 'object' || Object.keys(errors).length <= 0
. Doesn't matter though I guess.
This component will be used to show the errors of all fields.
afab553
to
4243468
Compare
* feat(number-field): add component * feat(field-errors): extract component This component will be used to show the errors of all fields. * fix(number-field): adapt import paths * test(text-field): adapt to renderError prop * feat(number-field): export from entry-point * docs(number-field): fix example import
This adds
NumberField
, which is very similar to theTextField
we already have.