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

onPressSignup breaks the card swap functionality #13

Closed
acerbetti opened this issue Sep 8, 2020 · 7 comments
Closed

onPressSignup breaks the card swap functionality #13

acerbetti opened this issue Sep 8, 2020 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@acerbetti
Copy link

Hi, thank you for this lib, I cannot understand well how do you set the callback for the signup flow?
Do you have a working example?

thanks

@WrathChaos WrathChaos self-assigned this Sep 8, 2020
@WrathChaos
Copy link
Owner

WrathChaos commented Sep 8, 2020

Hello @acerbetti,
onPressSignup changes the state of card between Login card and SignUp cards. That's why I make it optional press function for it. If the dev wants to do some custom stuff when onPressSignup is on pressed.

onPressSignup={() => {

As you can see in the code itself, it simply changes the state to handle SignUp card and Login card.

@acerbetti
Copy link
Author

thank you for the quick reply, but you can see that the props "onPressSignup" is also passed to the "BottomContainer" overriding the "setCardState" code and breaking the functionality

@WrathChaos
Copy link
Owner

Oh I see. Actually it does not break the functionality, as you can see it just call the parent's prop function. That's all, it does not the same onPressSignup prop. I guess the BottomContainer's onPressSignup prop should be renamed.

@WrathChaos
Copy link
Owner

Why do you think it breaks the functionality?

@acerbetti
Copy link
Author

Renaming the props on the BottomContainer should do the trick, but I think that is confusing to use the same callback "onPressLogin" on both login and signup flow.

Broken functionality is because if I pass the props onPressSignup to the LoginScreen, the toggle is not responding anymore

@WrathChaos
Copy link
Owner

Oh, I will fix that ASAP then. I did not know that. I have a plan to re-write the whole library with Typescript, I will also fix this with that.

Thank you for the contribution @acerbetti :) I believe I can make it tomorrow.

@WrathChaos WrathChaos added the bug Something isn't working label Sep 8, 2020
@WrathChaos WrathChaos changed the title onPressSignup onPressSignup breaks the card swap functionality Sep 8, 2020
@WrathChaos
Copy link
Owner

Hello @acerbetti,
I think I've fixed this issue on the newest version. I'm sorry it took some time but at least it works great now :)
Please check the new version:

Release 2.0.3 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants