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

How can I customize a popover and button using MUI? #484

Open
parth25 opened this issue Apr 1, 2024 · 0 comments
Open

How can I customize a popover and button using MUI? #484

parth25 opened this issue Apr 1, 2024 · 0 comments

Comments

@parth25
Copy link

parth25 commented Apr 1, 2024

useEffect(() => {
    const steps = [
      {
        element: '#Dashboard',
        popover: {
          title: 'Dashboard',
          description: 'The dashboard shows statistics',
          side: 'left',
          align: 'start',
          onNextClick: () => {
            router.push('/leads/?withRecognizedTerms=false&leadType=ALL_LEADS')
            driverObj.moveNext()
          }
        }
      }
    ]

    const filteredSteps: any = steps.filter(step => {
      const element = document.querySelector(step.element)

      return !step.element || element !== null
    })

    const driverObj = driver({
      showButtons: ['next', 'previous'],
      onNextClick: (element, step, opts) => {
        opts.config.showProgress = true
        driverObj.moveNext()
      },
      prevBtnText: 'Previous',
      doneBtnText: 'Next',
      showProgress: false,
      allowClose: false,
      steps: filteredSteps
    })

    driverObj.drive()
  }, [])
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

No branches or pull requests

1 participant