How to use the react-intl-inject-hoc.withGetMessages function in react-intl-inject-hoc

To help you get started, we’ve selected a few react-intl-inject-hoc 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 MCS-Lite / mcs-lite / packages / mcs-lite-mobile-web / src / containers / DeviceDataChannelDetail / index.js View on Github external
export default compose(
  connect(mapStateToProps, mapDispatchToProps),
  connectSocket(
    // 1. urlMapper => (ownerProps: Object) => string
    ({ deviceId, deviceKey }) =>
      deviceKey && `${wsHost}/deviceId/${deviceId}/deviceKey/${deviceKey}`,
    // 2. onMessage => (ownerProps: Object) => datapoint => void
    props => datapoint => props.setDatapoint(props.deviceId, datapoint, true),
    // 3. propsMapper => state => props
    ({ readyState, send, createWebSocket }) => ({
      sendMessage: send,
      isWebSocketClose: readyState.sender === 3 || readyState.viewer === 3,
      reconnect: createWebSocket,
    }),
  ),
  withGetMessages(messages, 'DeviceDataChannelDetail'),
)(DeviceDataChannelDetail);
github MCS-Lite / mcs-lite-app / client / app / components / deviceDetail / apiHint / index.js View on Github external
import { compose } from 'recompose';
import { withGetMessages } from 'react-intl-inject-hoc';
import messages from './messages';
import ApiHint from './ApiHint';

export default compose(withGetMessages(messages, 'ApiHint'))(ApiHint);
github MCS-Lite / mcs-lite / packages / mcs-lite-landing-web / src / containers / Section4 / index.js View on Github external
import { withGetMessages } from 'react-intl-inject-hoc';
import { compose, pure } from 'recompose';
import Section4 from './Section4';
import messages from './messages';

export default compose(withGetMessages(messages, 'Section4'), pure)(Section4);
github MCS-Lite / mcs-lite / packages / mcs-lite-landing-web / src / containers / Section2 / index.js View on Github external
import { withGetMessages } from 'react-intl-inject-hoc';
import { compose, pure } from 'recompose';
import Section2 from './Section2';
import messages from './messages';

export default compose(withGetMessages(messages, 'Section2'), pure)(Section2);
github MCS-Lite / mcs-lite / packages / mcs-lite-landing-web / src / components / DownloadButton / index.js View on Github external
import { withGetMessages } from 'react-intl-inject-hoc';
import { compose } from 'recompose';
import DownloadButton from './DownloadButton';
import messages from './messages';

export default compose(withGetMessages(messages, 'DownloadButton'))(
  DownloadButton,
);
github MCS-Lite / mcs-lite / packages / mcs-lite-landing-web / src / containers / Section3 / index.js View on Github external
import { withGetMessages } from 'react-intl-inject-hoc';
import { compose, pure } from 'recompose';
import Section3 from './Section3';
import messages from './messages';

export default compose(withGetMessages(messages, 'Section3'), pure)(Section3);
github MCS-Lite / mcs-lite / packages / mcs-lite-mobile-web / src / containers / Password / index.js View on Github external
import { connect } from 'react-redux';
import compose from 'recompose/compose';
import { withGetMessages } from 'react-intl-inject-hoc';
import messages from './messages';
import { actions } from '../../modules/auth';
import Password from './Password';

export const mapStateToProps = null;
export const mapDispatchToProps = { changePassword: actions.changePassword };

export default compose(
  connect(mapStateToProps, mapDispatchToProps),
  withGetMessages(messages, 'Password'),
)(Password);
github MCS-Lite / mcs-lite-app / client / app / components / profile / dialogs / changePasswordDialog.js View on Github external
<button kind="default">
        {t('cancel')}
      </button>
      <button kind="primary">
        {t('save')}
      </button>
    
  
);

export default compose(
  pure,
  withGetMessages(messages, 'Profile'),
  withState('newPassword', 'setNewPassword', ''),
  withState('confirmPassword', 'setConfirmPassword', ''),
  withState('error', 'setError', {
    newPassword: true,
    confirmPassword: true,
  }),
  withState('touched', 'setTouched', {
    newPassword: false,
    confirmPassword: false,
  }),
  withHandlers({
    closeDialog: props =&gt; () =&gt; props.setDialogShow('none'),
    onBlur: props =&gt; field =&gt; () =&gt; {
      props.setTouched({ ...props.touched, [field]: true });
    },
    onNewPasswordChange: props =&gt; (e) =&gt; {
github MCS-Lite / mcs-lite-app / client / app / components / profile / panel / index.js View on Github external
label={t('language')}
        &gt;
          {language}
        
      
    
  
);

export default compose(
  pure,
  withHandlers({
    onEditUserNameClick: props =&gt; () =&gt; props.setDialogShow('editUserName'),
    onChangePasswordClick: props =&gt; () =&gt; props.setDialogShow('changePassword'),
  }),
  withGetMessages(messages, 'Profile'),
  withProps((language) =&gt; {
    switch(localStorage.getItem('locale')) {
      case 'en':
        language = 'English';
        break;
      case 'zh-TW':
        language = '繁體中文';
        break;
      case 'zh-CN':
        language = '简体中文';
        break;
    }
    return { language };
  }),
)(ProfilePanel);
github MCS-Lite / mcs-lite-app / client / app / components / profile / dialogs / editUserNameDialog.js View on Github external
<button kind="default">
        {t('cancel')}
      </button>
      <button kind="primary">
        {t('save')}
      </button>
    
  
);

export default compose(
  pure,
  withGetMessages(messages, 'Profile'),
  withState('userName', 'setUserName', props =&gt; props.userName),
  withHandlers({
    closeDialog: props =&gt; () =&gt; props.setDialogShow('none'),
    onUserNameChange: props =&gt; e =&gt; props.setUserName(e.target.value),
    onSave: props =&gt; () =&gt; {
      props.editUserName(props.userName)
        .then(() =&gt; {
          props.pushToast({ kind: 'success', message: props.getMessages('editUserNameSuccess') });
        });
      props.setDialogShow('none');
    },
  }),
)(EditUserNameDialog);

react-intl-inject-hoc

The convenience HOC of react-intl injectIntl

MIT
Latest version published 6 years ago

Package Health Score

45 / 100
Full package analysis

Popular react-intl-inject-hoc functions