How to use the @shopgate/engage/core.router.update function in @shopgate/engage

To help you get started, we’ve selected a few @shopgate/engage 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 shopgate / pwa / themes / theme-gmd / components / AppBar / presets / DefaultBar / index.jsx View on Github external
const engageWillLeave =
      prevProps.app.isVisible === true && this.props.app.isVisible === false;

    if (routeDidEnter || engageDidEnter) {
      // Sync the colors of the app bar when the route with the bar came visible.
      this.updateStatusBar();
    }

    if (engageWillLeave) {
      // Reset the status bar when Engage goes into the background.
      this.props.resetStatusBar();
    }

    if (prevProps.title !== this.props.title) {
      const { __ } = this.context.i18n();
      router.update(this.props.route.id, { title: __(this.props.title) });
    }
  }
github shopgate / pwa / themes / theme-ios11 / components / AppBar / presets / DefaultBar / index.jsx View on Github external
const engageWillLeave =
      prevProps.app.isVisible === true && this.props.app.isVisible === false;

    if (routeDidEnter || engageDidEnter) {
      // Sync the colors of the app bar when the route with the bar came visible.
      this.updateStatusBar();
    }

    if (engageWillLeave) {
      // Reset the status bar when Engage goes into the background.
      this.props.resetStatusBar();
    }

    if (prevProps.title !== this.props.title) {
      const { __ } = this.context.i18n();
      router.update(this.props.route.id, { title: __(this.props.title) });
    }
  }
github shopgate / pwa / themes / theme-ios11 / components / AppBar / presets / DefaultBar / index.jsx View on Github external
}

    if (this.props.setFocus && target) {
      // Set the focus to the first focusable element for screen readers.
      const focusable = target.querySelector('button:not([aria-hidden="true"]), [tabindex]:not([tabindex="-1"])');

      if (focusable) {
        focusable.focus();
      }
    }

    if (this.props.route.visible) {
      this.updateStatusBar();
      if (this.props.title) {
        const { __ } = this.context.i18n();
        router.update(this.props.route.id, { title: __(this.props.title) });
      }
    }
  }
github shopgate / pwa / themes / theme-ios11 / pages / Filter / components / Content / index.jsx View on Github external
save = () => {
    const { currentFilters, filters } = this.state;

    router.update(
      this.props.parentId,
      { filters: buildUpdatedFilters(currentFilters, filters) }
    );
    setTimeout(router.pop, 250);
  }
github shopgate / pwa / themes / theme-gmd / pages / Filter / components / Content / index.jsx View on Github external
save = () => {
    const { currentFilters, filters } = this.state;

    router.update(
      this.props.parentId,
      { filters: buildUpdatedFilters(currentFilters, filters) }
    );
    setTimeout(router.pop, 250);
  }
github shopgate / pwa / themes / theme-gmd / components / AppBar / presets / DefaultBar / index.jsx View on Github external
if (!target) {
      target = document.getElementById('AppHeader');
      this.setState({ target: target || null });
    }

    if (this.props.setFocus) {
      this.setFocus();
    }

    if (this.props.route.visible) {
      this.updateStatusBar();

      if (this.props.title) {
        const { __ } = this.context.i18n();
        router.update(this.props.route.id, { title: __(this.props.title) });
      }
    }
  }