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

feat(core): Allow multiple indexes in a single AttachStep #143

Merged
merged 2 commits into from
Jan 17, 2025

Conversation

ravanscafi
Copy link
Contributor

@ravanscafi ravanscafi commented Mar 31, 2024

Hello!

Sorry for proposing this feature directly as a Pull Request, but I needed it for my own Tour and thought it would be nice to contribute to the project :)

Let me know what you think and how we can make it better!

childRef.current?.measureInWindow((x, y, width, height) => {
changeSpot({ height, width, x, y });
});
}
}, [changeSpot, current, index]);
}, [changeSpot, current, index.toString()]);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is needed to compare arrays, otherwise, they will always differ and useEffect will be called infinite times.

@@ -24,7 +24,7 @@ function TestScreen(): React.ReactElement {
<Text>{"Test Tour 1"}</Text>
</AttachStep>

<AttachStep index={1}>
<AttachStep index={[1]}>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this ensures using an array of indexes will break no other behaviors.

@FranzGB FranzGB requested a review from JoseLion April 12, 2024 23:26
@JoseLion JoseLion self-assigned this Jan 17, 2025
@JoseLion
Copy link
Member

@ravanscafi, thank you for your contribution! I'm sorry it took me so long to review this PR. I like the idea of attaching the same view to multiple steps. It provides more flexibility and reduces the need for code repetition.

We're currently working on a major release, so I'll pick it from here to resolve conflicts and ensure everything works with the planned changes. Thanks again for your contribution! 🎉

@JoseLion JoseLion force-pushed the attachstep-multiple branch from 7f3d1c2 to b264424 Compare January 17, 2025 22:46
Copy link
Member

@JoseLion JoseLion left a comment

Choose a reason for hiding this comment

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

I made a few changes, but in general this looks good to me! Thanks for your contribution 🎉

@JoseLion JoseLion merged commit 887a4b2 into stackbuilders:main Jan 17, 2025
5 checks passed
@JoseLion
Copy link
Member

@all-contributors please add @ravanscafi for code.

Copy link
Contributor

@JoseLion

I've put up a pull request to add @ravanscafi! 🎉

@JoseLion
Copy link
Member

@all-contributors please add @ravanscafi for code.

Copy link
Contributor

@JoseLion

@ravanscafi already contributed before to code

@ravanscafi
Copy link
Contributor Author

Thank you @JoseLion! 🎉

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