This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 833
Conversation
This file contains 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
This converts most fields in the registration form to use the Field component, except for the phone number, which is a left as a separate task because of the country dropdown menu.
By placing the Field's border on the Field component root instead of the input, it's easier to wrap it around additional elements that we'll soon stuff inside the field.
This allows Fields to have an optional prefix component which is placed inside the border of the Field and to the left of the input. Since this label animation would be complex to get right for this case, it is instead fixed to the top left if there is a prefix component. This canonical example of this today would be a phone number field which includes a country dropdown.
Now that we have prefix support in the Field component, we can also convert the phone number with country dropdown on registration.
This converts all fields in the forgot password form to use the Field component.
As with other auth flows, this converts inputs on the login page to use the Field component for consistent styling. The login type dropdown is left as-is for now.
This converts the login type Dropdown on the login flow to also use the Field component so that every presents a similar visual style.
turt2live
approved these changes
Mar 5, 2019
<Field | ||
className={pwFieldClass} | ||
id="mx_PasswordLogin_password" | ||
ref={(e) => {this._passwordField = e;}} |
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.
tbh I'm a little surprised the linter isn't screaming about this.
also TIL that this is the recommended way to do refs now.
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.
Hmm, several things to say here...
- I happen to just be moving existing
refs
code here, as I didn't want to change that much since it's not directly related (other auth modules still use older strings refs, for example). (I was worried you'd be sad I was mixing too much in one PR if I also clean up those sorts of code style things!) - Is it the spacing that you'd expect linting errors for?
- Since string refs are deprecated, we may want to enable the
react/no-string-refs
linting rule and clean then up
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.
This changes to the Field component throughout the auth flows for consistent, modern visual styling.
Reviewer: Each commit in this PR is self-contained and has some additional context in the commit message, so you may want to review commit by commit.
Fixes element-hq/element-web#8262