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

refactor/login: Refactor heavily-entangled LoginForm component #987

Merged
merged 8 commits into from
Dec 1, 2020

Conversation

liangyuanruo
Copy link
Contributor

@liangyuanruo liangyuanruo commented Nov 30, 2020

Problem

The login page and its components were heavily entwined. This made it difficult to reason about interactions and dependencies, or to remove its Redux dependenices.

Part of #955

Solution

Refactor the LoginForm component to be fully functional. Instead of having inside knowledge of the login flow, it is now configured from outside the component. Instead of hardcoding if-else statements to decide which components to show, it now accepts children as props.

It has been upgraded to become a fully controlled component via the value prop, whereas previously it was relying on a hack using the hidden property to remove DOM input (i.e. user email) when the login page transits from email stage to the OTP stage.

@liangyuanruo liangyuanruo changed the title refactor/login: Login OTP refactor/login: Refactor heavily-entangled LoginForm component Nov 30, 2020
Copy link
Member

@yong-jie yong-jie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@liangyuanruo liangyuanruo merged commit 88c65d6 into develop Dec 1, 2020
@liangyuanruo liangyuanruo deleted the refactor/login branch December 1, 2020 01:47
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.

2 participants