How to use the @shopgate/pwa-core/emitters/ui.addListener function in @shopgate/pwa-core

To help you get started, we’ve selected a few @shopgate/pwa-core 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-ios11 / pages / Product / components / AddToCartBar / index.jsx View on Github external
constructor() {
    super();

    this.target = document.getElementById('AppFooter');
    this.state = {
      clicked: false,
      visible: true,
      added: 0,
    };

    this.ref = React.createRef();
    this.moreButtonRef = React.createRef();

    UIEvents.addListener(constants.SHOW_ADD_TO_CART_BAR, this.handleShow);
    UIEvents.addListener(constants.HIDE_ADD_TO_CART_BAR, this.handleHide);
    UIEvents.addListener(constants.INCREMENT_ACTION_COUNT, this.handleIncrement);
    UIEvents.addListener(constants.DECREMENT_ACTION_COUNT, this.handleDecrement);
    UIEvents.addListener(constants.RESET_ACTION_COUNT, this.handleReset);
  }
github shopgate / pwa / themes / theme-ios11 / pages / Product / components / AddToCartBar / index.jsx View on Github external
this.target = document.getElementById('AppFooter');
    this.state = {
      clicked: false,
      visible: true,
      added: 0,
    };

    this.ref = React.createRef();
    this.moreButtonRef = React.createRef();

    UIEvents.addListener(constants.SHOW_ADD_TO_CART_BAR, this.handleShow);
    UIEvents.addListener(constants.HIDE_ADD_TO_CART_BAR, this.handleHide);
    UIEvents.addListener(constants.INCREMENT_ACTION_COUNT, this.handleIncrement);
    UIEvents.addListener(constants.DECREMENT_ACTION_COUNT, this.handleDecrement);
    UIEvents.addListener(constants.RESET_ACTION_COUNT, this.handleReset);
  }
github shopgate / pwa / themes / theme-ios11 / pages / Product / components / AddToCartBar / index.jsx View on Github external
constructor() {
    super();

    this.target = document.getElementById('AppFooter');
    this.state = {
      clicked: false,
      visible: true,
      added: 0,
    };

    this.ref = React.createRef();
    this.moreButtonRef = React.createRef();

    UIEvents.addListener(constants.SHOW_ADD_TO_CART_BAR, this.handleShow);
    UIEvents.addListener(constants.HIDE_ADD_TO_CART_BAR, this.handleHide);
    UIEvents.addListener(constants.INCREMENT_ACTION_COUNT, this.handleIncrement);
    UIEvents.addListener(constants.DECREMENT_ACTION_COUNT, this.handleDecrement);
    UIEvents.addListener(constants.RESET_ACTION_COUNT, this.handleReset);
  }
github shopgate / pwa / libraries / ui-shared / Footer / index.jsx View on Github external
const observer = new MutationObserver((mutations) => {
      const update = mutations
        .filter(mutation => mutation.target.getAttribute(DATA_IGNORED) !== 'true').length > 0;

      if (update) {
        this.performFooterUpdate();
      }
    });

    observer.observe(this.ref.current, {
      attributes: true,
      childList: true,
      subtree: true,
    });
    UIEvents.addListener(SHEET_EVENTS.OPEN, this.hide);
    UIEvents.addListener(SHEET_EVENTS.CLOSE, this.show);
  }
github shopgate / pwa / themes / theme-ios11 / pages / Product / components / AddToCartBar / index.jsx View on Github external
constructor() {
    super();

    this.target = document.getElementById('AppFooter');
    this.state = {
      clicked: false,
      visible: true,
      added: 0,
    };

    this.ref = React.createRef();
    this.moreButtonRef = React.createRef();

    UIEvents.addListener(constants.SHOW_ADD_TO_CART_BAR, this.handleShow);
    UIEvents.addListener(constants.HIDE_ADD_TO_CART_BAR, this.handleHide);
    UIEvents.addListener(constants.INCREMENT_ACTION_COUNT, this.handleIncrement);
    UIEvents.addListener(constants.DECREMENT_ACTION_COUNT, this.handleDecrement);
    UIEvents.addListener(constants.RESET_ACTION_COUNT, this.handleReset);
  }
github shopgate / pwa / themes / theme-ios11 / pages / Product / components / AddToCartBar / index.jsx View on Github external
super();

    this.target = document.getElementById('AppFooter');
    this.state = {
      clicked: false,
      visible: true,
      added: 0,
    };

    this.ref = React.createRef();
    this.moreButtonRef = React.createRef();

    UIEvents.addListener(constants.SHOW_ADD_TO_CART_BAR, this.handleShow);
    UIEvents.addListener(constants.HIDE_ADD_TO_CART_BAR, this.handleHide);
    UIEvents.addListener(constants.INCREMENT_ACTION_COUNT, this.handleIncrement);
    UIEvents.addListener(constants.DECREMENT_ACTION_COUNT, this.handleDecrement);
    UIEvents.addListener(constants.RESET_ACTION_COUNT, this.handleReset);
  }
github shopgate / pwa / libraries / ui-shared / Footer / index.jsx View on Github external
const observer = new MutationObserver((mutations) => {
      const update = mutations
        .filter(mutation => mutation.target.getAttribute(DATA_IGNORED) !== 'true').length > 0;

      if (update) {
        this.performFooterUpdate();
      }
    });

    observer.observe(this.ref.current, {
      attributes: true,
      childList: true,
      subtree: true,
    });
    UIEvents.addListener(SHEET_EVENTS.OPEN, this.hide);
    UIEvents.addListener(SHEET_EVENTS.CLOSE, this.show);
  }