-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Refactor registration #399
Conversation
Hook it up to MatrixChat instead of the existing logic (this breaks reg). WIP.
This is complex enough that the Registration component shouldn't have to care about it, so it should probably be split into a pure UI component.
…HTTP hit if we've been given good QPs
This has to be done rather than in MatrixChat because the render() calls will create new instances otherwise. Pass in all the strings the logic class requires to the Registration wire component. This isn't the "best" solution because unloading/reloading the Registration component will lose registration state which should be persisted. Ideally we'd DI from the top to ensure this can't happen (as opposed to relying on module globals...)
</div> | ||
); | ||
} | ||
}); |
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.
This component look simple / generic enough it could potentially go into react-sdk in the long term?
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.
Absolutely, I should've seen that. Will re-jig now else I'll never get around to it.
lgtm |
This is the sister PR to matrix-org/matrix-react-sdk#34
This PR factors out a lot of UI components from the
Register
component. The new components are:CaptchaForm
- Renders thediv
which Recaptcha needs. Does thecomponentDidUpdate
script voodoo to make it actually work.RegistrationForm
- Contains the elements for the email/user/password. Does basic validation like checking passwords match/exist/length and calls theonError
prop accordingly.It adds a new wire component
Registration
which glues everything together. Specifically it:Signup.Register
.CaptchaForm
).There's a few things I'd like to do to improve this further, but I'm conscious of keeping PRs manageable so have littered a few
TODOs
.Manually tested: