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

Add onPress support in the middle of steps #71

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

Conversation

iamsoorena
Copy link

This PR only works with copilot with overlay: 'view'.
This is how we can use it:

const CopilotTouchableOpacity = walkthroughable(TouchableOpacity)
...
<CopilotStep text="some text" order={1} name="someName">
  <CopilotTouchableOpacity
    onPress={someFunction}
  >
    ...
  </CopilotTouchableOpacity>
</CopilotStep>

note:
since I think RTL is a must have, I've not made a new branch from master but this a branch from rtl branch I sent for you yesterday.

@mohebifar
Copy link
Owner

Could you please provide some more insight on this? What were you trying to achieve? I'd suggest any PR that introduces a new feature should have to add a short howto to the readme.

@iamsoorena
Copy link
Author

@mohebifar I need some time to come up with a good explanation. I'll let you know when that happened.

@RichardLitt RichardLitt added the needed: more information We're waiting for feedback from the person who created the issue. label Sep 20, 2018
@RichardLitt
Copy link
Contributor

@iamsoorena Any chance you have found some time for this? :)

@iamsoorena
Copy link
Author

@RichardLitt I'm so sorry for the delay.
I'll do it this week.

@RichardLitt
Copy link
Contributor

There's no rush! Just curious. :)

@iamsoorena
Copy link
Author

@RichardLitt I've added description to Readme.
If there's anything else, let me know.

@RichardLitt RichardLitt removed the needed: more information We're waiting for feedback from the person who created the issue. label Nov 12, 2018
@mohebifar
Copy link
Owner

LGTM @iamsoorena, thanks again. I just added a few comments.

@iamsoorena
Copy link
Author

@mohebifar Where can I find your comments?
Should I change sth?!

@RichardLitt
Copy link
Contributor

@mohebifar Did you forget to click "Review changes" after making comments? Sometimes, that leads to them not being posted.

},
]}
/>
<TouchableOpacity
Copy link
Owner

Choose a reason for hiding this comment

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

Could we just not render TouchableOpacity component when we don't need touchable steps?

let stepNumberLeft = obj.left - STEP_NUMBER_RADIUS;
let stepNumberLeft;

const edgeCase = (stepLeft) => {
Copy link
Owner

Choose a reason for hiding this comment

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

Is there a reason it is named "edge case"?

import type { CopilotContext, valueXY } from '../types';


const rtl = I18nManager.isRTL;
Copy link
Owner

Choose a reason for hiding this comment

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

I'm still concerned about changing the direction dynamically.

Copy link
Owner

Choose a reason for hiding this comment

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

I wonder if RN's I18nManager even lets you change the direction back and forth in runtime. In that case, the RTL check must be moved to the component's lifecycle callbacks probably.

@mohebifar
Copy link
Owner

Yes, sorry for that. Just submitted.

@danstn
Copy link

danstn commented Jul 3, 2019

This would be epic! Any chance this can get resolved sooner rather than later? :)

Awesome lib btw 👊

@mohebifar
Copy link
Owner

@iamsoorena Could you please look into this again?

@gilsonviana
Copy link

Guys any update on this? Being able to interact with the guide is crucial for the guide flow itself. This is an awesome library.

@mikefogg
Copy link

This looks soo close to being ready to add. Is there anything I can do to help get this implemented in the library?

@mohebifar
Copy link
Owner

@mikefogg Do you think you can own this i.e. address the comments, rebase, and open a new PR?

@iujisato
Copy link

iujisato commented Oct 6, 2020

hello guys, I'm currently testing this lib in our app and we need a feature to let people click on the highlight step

I've already made a change to detect clicks inside the mask highlight and outside it. I've seen that the original author here just made a change to let the component pass the original click function.

@mohebifar do you think that my approach to let people click on the highlight mask is better or worse than this approach to just enable the original component click?

The original author approach seems better to not duplicate the click function, but my approach has versatility because we can just change the click behavior on copilot wrapped components (instead of following the original component click)

If you want I can open a PR based on this approach, or change it to respect the original author approach (I'm redoing everything, not just rebasing and fixing the comments above)

@iujisato
Copy link

iujisato commented Oct 6, 2020

@mikefogg @gilsonviana @danstn ☝️

do you think that my approach can handle your use case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants