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: new onboarding navigation #17582

Merged
merged 6 commits into from
Sep 25, 2023
Merged

Conversation

raquelmsmith
Copy link
Member

Problem

We need to know based on the URL what step we are on, and go to the correct step given a single URL. This needs to work for "named" steps, but also unnamed steps for making the process of creating onboarding flows easier.

Changes

I found creating this logic complicated. Each step that the onboarding natively supports (sdks, billing, intro) has a key, eg ?step=billing. This needs to be dynamic because the billing step won't always be there, and it won't always be in the same order. So we have all the steps stored and find the component with the correct component name for the key.

If something is just an <OnboardingStep> then it won't have a special name, so we set the step key as the step number.

This works in both directions - navigating to a URL with a specific step and also using the app to go to the next step, the URL will update.

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

How did you test this code?

No tests yet...

@raquelmsmith raquelmsmith merged commit 7a8a268 into master Sep 25, 2023
72 checks passed
@raquelmsmith raquelmsmith deleted the feat/onboarding-navigation branch September 25, 2023 15:15
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.

1 participant