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

[EuiTour] Single injection component #5716

Closed
thompsongl opened this issue Mar 14, 2022 · 2 comments
Closed

[EuiTour] Single injection component #5716

thompsongl opened this issue Mar 14, 2022 · 2 comments

Comments

@thompsongl
Copy link
Contributor

Could there be an easier way of injecting all the tour steps in to one spot now? In the video above, I ended up making a new DiscoverGridTour component that returns the following:

return (
    <>
      <EuiTourStep
        {...euiTourStepOne}
        footerAction={
          <EuiButtonEmpty color="text" flush="right" size="xs" onClick={actions.incrementStep}>
            Next
          </EuiButtonEmpty>
        }
      />
      <EuiTourStep {...euiTourStepTwo} />
    </>
  );

Then, right above the DiscoverGrid component in discover_grid.tsx I was able to inject these tour steps using the following:

...
return (
    <>
      <DiscoverGridTour /> // <--- Injecting all the steps right here
      <DiscoverGridContext.Provider
        value={{
          expanded: expandedDoc,
... 

We probably don't want tours with more than a handful of steps anyway, but having to manually spread each EuiTourStepProp is a bit clunky - this could be done with a loop or something to make it smaller, but perhaps worth considering another option entirely? Similar to how the EuiTour component works in the "Managed state via EuiTour render prop component" documentation example, but without having to spread each step. Totally possible this already exists and I missed it, though :)

Originally posted by @Heenawter in #5696 (comment)

@github-actions
Copy link

👋 Hey there. This issue hasn't had any activity for 180 days. We'll automatically close it if that trend continues for another week. If you feel this issue is still valid and needs attention please let us know with a comment.

@github-actions
Copy link

❌ We're automatically closing this issue due to lack of activity. Please comment if you feel this was done in error.

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

No branches or pull requests

1 participant