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 NumberField #74

Merged
merged 6 commits into from
Sep 24, 2018
Merged

Add NumberField #74

merged 6 commits into from
Sep 24, 2018

Conversation

dferber90
Copy link
Contributor

This adds NumberField, which is very similar to the TextField we already have.

@dferber90 dferber90 changed the title Add NumberField Add NumberField Sep 18, 2018
Copy link
Contributor

@tdeekens tdeekens left a 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
Copy link
Contributor

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';
Copy link
Contributor

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.

@dferber90 dferber90 requested a review from lufego September 18, 2018 13:47
@dferber90 dferber90 merged commit ae7b813 into master Sep 24, 2018
lufego pushed a commit that referenced this pull request Oct 1, 2018
* 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
@dferber90 dferber90 deleted the df-number-field branch October 4, 2018 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants