How to use the react-joyride.STATUS.SKIPPED function in react-joyride

To help you get started, we’ve selected a few react-joyride examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github chaskiq / chaskiq / app / javascript / client_messenger / tourManager.js View on Github external
} else if (action === ACTIONS.PREV) {
          t = this.state.steps[index - 1]
        }

        if(!t) return
        const a = document.querySelector(t.target)
        centerDiv(a)
      }

      

      // Update state to advance the tour
      //this.setState({ stepIndex: index + (action === ACTIONS.PREV ? -1 : 1) });
    }
    else if ([STATUS.FINISHED, STATUS.SKIPPED].includes(status)) {
      // Need to set our running state to false, so we can restart if we click start again.
      this.setState({ run: false });
    }

    console.groupCollapsed(type);
    console.log(data); //eslint-disable-line no-console
    console.groupEnd();
  };
github chaskiq / chaskiq / app / javascript / client_messenger / UserTour.js View on Github external
handleJoyrideCallback = data => {
    const { action, index, status, type } = data;

    if ([EVENTS.STEP_AFTER, EVENTS.TARGET_NOT_FOUND].includes(type)) {
      // Update state to advance the tour
      this.setState({ stepIndex: index + (action === ACTIONS.PREV ? -1 : 1) });
    }
    else if ([STATUS.FINISHED, STATUS.SKIPPED].includes(status)) {
      // Need to set our running state to false, so we can restart if we click start again.
      this.setState({ run: false });
      this.registerEvent(status)
    }

    console.groupCollapsed(type);
    console.log(data); //eslint-disable-line no-console
    console.groupEnd();
  };
github burtonator / polar-bookshelf / web / js / apps / repository / RepositoryTour.tsx View on Github external
mutationObserver = new MutationObserver(mutationHandler);

            mutationObserver.observe(document.body, {
                childList: true,
                attributes: true,
                subtree: true
            });

            // call it once manually after the event was registered as the
            // element might already be visible in the DOM at which point we're
            // already done.
            mutationHandler();

        }

        if (callbackProps.status === STATUS.SKIPPED || callbackProps.status === STATUS.FINISHED) {

            try {

                // FIXME?
                // this.setState({ run: false, stepIndex: 0 });

                switch (callbackProps.status) {
                    case STATUS.SKIPPED:
                        RendererAnalytics.event({category: 'tour-result', action: 'skipped'});
                        RendererAnalytics.event({category: 'tour-skip', action: 'skipped-at-step-' + callbackProps.index});

                        LifecycleToggle.mark(LifecycleEvents.TOUR_SKIPPED);
                        break;
                    case STATUS.FINISHED:
                        RendererAnalytics.event({category: 'tour-result', action: 'finished'});
github Vizzuality / gfw / app / javascript / components / prompts / component.jsx View on Github external
callback={data => {
          const { action, index, type, status, step } = data;
          const { actions } = step || {};
          const { prev, next } = actions || {};

          if ([STATUS.FINISHED, STATUS.SKIPPED].includes(status)) {
            // Need to set our running state to false, so we can restart if we click start again.
            handleStateChange({ open: false, stepIndex: 0, stepsKey: '' });
          } else if (data.action === 'close' || data.type === 'tour:end') {
            handleStateChange({
              stepIndex: 0,
              open: false
            });
          } else if (
            [
              EVENTS.STEP_AFTER,
              EVENTS.TARGET_NOT_FOUND,
              EVENTS.TOUR_START
            ].includes(type)
          ) {
            const newStepIndex = index + (action === ACTIONS.PREV ? -1 : 1);
            // Update state to advance the tour
github burtonator / polar-bookshelf / web / js / apps / repository / RepositoryTour.tsx View on Github external
// call it once manually after the event was registered as the
            // element might already be visible in the DOM at which point we're
            // already done.
            mutationHandler();

        }

        if (callbackProps.status === STATUS.SKIPPED || callbackProps.status === STATUS.FINISHED) {

            try {

                // FIXME?
                // this.setState({ run: false, stepIndex: 0 });

                switch (callbackProps.status) {
                    case STATUS.SKIPPED:
                        RendererAnalytics.event({category: 'tour-result', action: 'skipped'});
                        RendererAnalytics.event({category: 'tour-skip', action: 'skipped-at-step-' + callbackProps.index});

                        LifecycleToggle.mark(LifecycleEvents.TOUR_SKIPPED);
                        break;
                    case STATUS.FINISHED:
                        RendererAnalytics.event({category: 'tour-result', action: 'finished'});

                        LifecycleToggle.mark(LifecycleEvents.TOUR_FINISHED);
                        break;
                }

            } finally {
                LifecycleToggle.mark(LifecycleEvents.TOUR_TERMINATED);
            }
github NUS-ALSET / achievements / src / components / forms / CustomTaskPreviewForm.js View on Github external
onJoyrideCallback = data =>
    [STATUS.FINISHED, STATUS.SKIPPED].includes(data.status) &&
    this.setState({ runTour: false });
  onSolutionChange = solution => this.setState({ solution });
github burtonator / polar-bookshelf / web / js / apps / viewer / ViewerTour.tsx View on Github external
private onCallback(callbackProps: CallBackProps): void {

        RendererAnalytics.event({category: 'viewer-tour-steps', action: 'did-step-' + callbackProps.index});

        if (callbackProps.status === STATUS.SKIPPED || callbackProps.status === STATUS.FINISHED) {

            try {

                switch (callbackProps.status) {

                    case STATUS.SKIPPED:
                        RendererAnalytics.event({category: 'viewer-tour-result', action: 'skipped'});
                        RendererAnalytics.event({category: 'viewer-tour-skip', action: 'skipped-at-step-' + callbackProps.index});

                        LifecycleToggle.mark(LifecycleEvents.VIEWER_TOUR_SKIPPED);
                        break;

                    case STATUS.FINISHED:
                        RendererAnalytics.event({category: 'viewer-tour-result', action: 'finished'});

                        LifecycleToggle.mark(LifecycleEvents.VIEWER_TOUR_FINISHED);
github burtonator / polar-bookshelf / web / js / apps / viewer / ViewerTour.tsx View on Github external
private onCallback(callbackProps: CallBackProps): void {

        RendererAnalytics.event({category: 'viewer-tour-steps', action: 'did-step-' + callbackProps.index});

        if (callbackProps.status === STATUS.SKIPPED || callbackProps.status === STATUS.FINISHED) {

            try {

                switch (callbackProps.status) {

                    case STATUS.SKIPPED:
                        RendererAnalytics.event({category: 'viewer-tour-result', action: 'skipped'});
                        RendererAnalytics.event({category: 'viewer-tour-skip', action: 'skipped-at-step-' + callbackProps.index});

                        LifecycleToggle.mark(LifecycleEvents.VIEWER_TOUR_SKIPPED);
                        break;

                    case STATUS.FINISHED:
                        RendererAnalytics.event({category: 'viewer-tour-result', action: 'finished'});

                        LifecycleToggle.mark(LifecycleEvents.VIEWER_TOUR_FINISHED);
                        break;
                }

            } finally {
                LifecycleToggle.mark(LifecycleEvents.VIEWER_TOUR_TERMINATED);
            }