-
-
Notifications
You must be signed in to change notification settings - Fork 549
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.
Couple minor things, but looks good!
src/forms/FormTextInput.react.js
Outdated
+onChange?: (SyntheticInputEvent<HTMLInputElement>) => void, | ||
+onBlur?: (SyntheticInputEvent<HTMLInputElement>) => void, | ||
...FormInputProps, | ||
+label?: string, | ||
|}; | ||
|
||
type State = {| | ||
value: string | number, | ||
|}; | ||
|
||
class FormTextInput extends React.PureComponent<Props, State> { |
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.
Since we are removing the state, let's make this a pure component
@@ -0,0 +1,13 @@ | |||
//@flow | |||
const strings = { |
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.
What is the advantage of having this in its own file?
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.
Mostly just to help reduce file length but also thought it might help at a later date if we decide to implement a more complex strings/translations system
🎉 This PR is included in version 1.7.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Adds a reusable
LoginPage
component taken from the example site. Works well with libraries such as formik and uses astrings
prop for editing displayed strings.LoginPage
is wrapped in a new HOC that helps when working with form field touched and error states. It'll be handy for similar components in the future too.FormTextInput has had most of its internals removed as some are handled by React and props are now pretty much all imported and sent straight to Form.Input.