This repository was archived by the owner on Mar 3, 2020. It is now read-only.
Mibs/feature form#15
Open
mibsbalsante wants to merge 270 commits intomasterfrom
Open
Conversation
added 30 commits
July 19, 2018 16:36
that is composed of a `label` passed as `children` prop, a `Input` component and a error message passed as `errorMessage` prop
…put and error message
…s in Input component
…e prop to custom validation rul
… verify if submit is valid
…n some FormField has erros
…t-next-boilerplate into mibs/feature-storybook
that is composed of a `label` passed as `children` prop, a `Input` component and a error message passed as `errorMessage` prop
…put and error message
…s in Input component
added 20 commits
July 30, 2018 11:42
…next-boilerplate into mibs/feature-form
…ext-boilerplate into mibs/feature-form
douglasgimli
suggested changes
Aug 20, 2018
Member
douglasgimli
left a comment
There was a problem hiding this comment.
Awesome work, a few small inline comments :) 👏 👏 👏
|
|
||
| const Checkbox = props => { | ||
| const { className, isChecked } = props | ||
| const inputClasses = classNames({ |
Member
There was a problem hiding this comment.
When using classnames with fixed and dynamic fields you can use it like this:
classNames(className, styles.input, { [styles.checked]: isChecked })
No need to add the true to the fixed items.
| }) | ||
|
|
||
| return ( | ||
| <label className={styles.checkbox} role="checkbox" aria-checked={isChecked}> |
Member
There was a problem hiding this comment.
Is the label necessary? It should be used to add labels to fields, but there's no label here.
|
|
||
| Checkbox.propTypes = { | ||
| className: PropTypes.string, | ||
| id: PropTypes.string.isRequired, |
| value, | ||
| onChange: handleChange, | ||
| } | ||
| return multiline ? <textarea {...props} /> : <input {...props} type={type} checked={checked} /> |
| color: #323232; | ||
| border: 1px solid #979797; | ||
| border-radius: 3px; | ||
| padding: .6rem .8rem; |
| const labelProps = { htmlFor: field } | ||
|
|
||
| const labelComponent = | ||
| label && label.type ? ( |
Member
There was a problem hiding this comment.
Why did you clone the element?
| isSubmitValid: {}, | ||
| } | ||
| } | ||
| onSubmit = ev => { |
Member
There was a problem hiding this comment.
I'd like more to use the explicit approach, there's no need to use the abbreviation, why not use event?
| styles['font-default'] = "'Source Sans Pro', sans-serif" | ||
| styles['font-header'] = "'Poppins', sans-serif" | ||
| styles['color-blue'] = '#60cae5' | ||
| styles['color-focusable-blue'] = '#91d0d9' |
Member
There was a problem hiding this comment.
Commented about this above.
| @@ -0,0 +1,20 @@ | |||
| import validations from './validations' | |||
| @@ -0,0 +1,16 @@ | |||
| /* eslint-disable no-useless-escape */ | |||
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What is new?