How to use the ringcentral-widgets/lib/phoneContext.withPhone function in ringcentral-widgets

To help you get started, we’ve selected a few ringcentral-widgets 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 ringcentral / ringcentral-js-widgets / packages / ringcentral-widgets-cli / templates / Project / src / containers / MainView / index.js View on Github external
return {
    tabs: TABS,
    currentPath: routerInteraction.currentPath,
  };
}
function mapToFunctions(_, { phone: { routerInteraction } }) {
  return {
    goTo: (path) => {
      if (path) {
        routerInteraction.push(path);
      }
    },
  };
}

const MainView = withPhone(
  connect(
    mapToProps,
    mapToFunctions,
  )(TabNavigationView),
);

export default MainView;
github ringcentral / ringcentral-js-widgets / packages / ringcentral-widgets-demo / dev-server / containers / MainView / index.js View on Github external
function mapToFunctions(_, { phone, phone: { routerInteraction } }) {
  return {
    goTo(path) {
      if (path) {
        if (path === '/dialer' && hasActiveCalls(phone)) {
          routerInteraction.push('/calls');
        } else {
          routerInteraction.push(path);
        }
      }
    },
  };
}

const MainView = withPhone(
  connect(
    mapToProps,
    mapToFunctions,
  )(TabNavigationView),
);

export default MainView;

ringcentral-widgets

RingCentral Integration Widget Library

MIT
Latest version published 3 years ago

Package Health Score

43 / 100
Full package analysis

Similar packages