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

fix-style #46

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

fix-style #46

wants to merge 3 commits into from

Conversation

L0NG4R3S
Copy link

Hello!

There is a problem with your style prop, it is not being passed through to your Hcaptcha component. I don't have permission to create a pull request, but I have forked the repository and fixed the problem.

I want to use your library in my project, but this style problem is getting in the way, can you guys fix it? I'm uploading the correction.

@zoryana94
Copy link

Hi @L0NG4R3S!
What is your use case, is there anything specific you would like to achieve with passing the style prop?
If yes, have you tested that it would work as expected?

And thank you a lot for creating the PR! 👍

@L0NG4R3S
Copy link
Author

Well, my problem is that when I don't have a good internet connection, it takes a while for the HCaptcha component to disappear on its own. I need a cancel button in case my users get anxious (which they usually do).
My goal with the style property was to make the component smaller and place a cancel button at the bottom, but it may not work with the way components are structured.

But I found a new solution, if I can pass a footer component I can make this cancel button.

I've updated my pull request. If you guys approve it, I will pass my footer component like that:
<ConfirmHcaptcha ref={(ref) => { hCaptcha.current = ref; }} siteKey="38907250-4e73-4780-8633-388f6dc872b2" baseUrl="http://mySite.com" languageCode="en" onMessage={onMessage} size="invisible" footerComponent={ <CancelButton testID="recapcthaCancelButton" onPress={() => hCaptcha?.current?.hide()}> <CancelButtonText>{t('cancel')}</CancelButtonText> </CancelButton> } />

And it will look like that on my screen, here you guys can see the calcel button at the bottom:
Screenshot 2023-10-11 at 10 04 45

When the user press the button, the HCaptcha component will hide

@brdlyptrs
Copy link

Hi @L0NG4R3S, by default if the user clicks outside of the challenge area the interface should close automatically, see code. Alternatively, you can programmatically trigger the modal to close by calling its exposed .hide() method or updating the prop show to be false.

@L0NG4R3S
Copy link
Author

I don't think clicking outside to close works when there is a bad internet connection. When we have a bad connection the HCaptcha modal doesn't open and it also doesn't close when we click, that's why we need a cancel button:

20231013153039729.mp4

Also with a footer component, I could do my loading status, because as seen in the video it isn't working very well. It stops loading but the HCaptcha component doesn't open up:

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.

3 participants