How to use the react-intl.intlShape.isRequired function in react-intl

To help you get started, we’ve selected a few react-intl 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 meedan / check-web / src / app / components / TermsOfService.js View on Github external
class Tos extends Component {
  render() {
    const about = this.props.about;
    return (
      
        <div>
          <h2>Terms of Service</h2>
          <div id="tos">
        </div>
      
    );
  }
}

Tos.propTypes = {
  intl: intlShape.isRequired,
};

const TosContainer = Relay.createContainer(injectIntl(Tos), {
  fragments: {
    about: () =&gt; Relay.QL`
      fragment on About {
        tos
      }
    `,
  },
});

class TermsOfService extends Component {
  render() {
    const route = new AboutRoute();
    return ();</div>
github bigbluebutton / bigbluebutton / bigbluebutton-html5 / imports / ui / components / fullscreen-button / component.jsx View on Github external
import React from 'react';
import { defineMessages, injectIntl, intlShape } from 'react-intl';
import Button from '/imports/ui/components/button/component';
import cx from 'classnames';
import PropTypes from 'prop-types';
import { styles } from './styles';

const intlMessages = defineMessages({
  fullscreenButton: {
    id: 'app.fullscreenButton.label',
    description: 'Fullscreen label',
  },
});

const propTypes = {
  intl: intlShape.isRequired,
  fullscreenRef: PropTypes.instanceOf(Element),
  dark: PropTypes.bool,
  bottom: PropTypes.bool,
  isIphone: PropTypes.bool,
  isFullscreen: PropTypes.bool,
  elementName: PropTypes.string,
  className: PropTypes.string,
  handleToggleFullScreen: PropTypes.func.isRequired,
};

const defaultProps = {
  dark: false,
  bottom: false,
  isIphone: false,
  isFullscreen: false,
  elementName: '',
github samtecspg / articulate / new-ui / app / containers / CategoryPage / Components / CategoryDataForm.js View on Github external
color="primary"
                    /&gt;
                  }
                  label={intl.formatMessage(messages.extraTrainingData)}
                /&gt;
              
            
          
        
      );
    }
}

CategoryDataForm.propTypes = {
  classes: PropTypes.object.isRequired,
  intl: intlShape.isRequired,
  category: PropTypes.object,
  onChangeCategoryData: PropTypes.func.isRequired,
  onChangeActionThreshold: PropTypes.func,
  errorState: PropTypes.object,
};

export default injectIntl(withStyles(styles)(CategoryDataForm));
github Emurgo / yoroi-frontend / app / components / uri / URIInvalidDialog.js View on Github external
id: 'uri.invalid.dialog.warning.text2',
    defaultMessage: '!!!Please ask the receiver to double-check the format.',
  },
});

type Props = {
  +onClose: void =&gt; void,
  +onSubmit: void =&gt; void,
  +classicTheme: boolean,
};

@observer
export default class URIInvalidDialog extends Component {

  static contextTypes = {
    intl: intlShape.isRequired,
  };

  render() {
    const { onClose, onSubmit, classicTheme } = this.props;

    const dialogClasses = classnames([
      styles.component,
      'URIInvalidDialog'
    ]);

    const { intl } = this.context;

    const actions = [
      {
        label: intl.formatMessage(globalMessages.continue),
        onClick: onSubmit,
github reportportal / service-ui / app / src / pages / inside / logsPage / modals / attachments / attachmentCodeModal.jsx View on Github external
import { DEFAULT_HIGHLIGHT_STYLE } from 'common/constants/hightLightStyle';
import { LOG_PAGE_EVENTS } from 'components/main/analytics/events';
import { ModalLayout, withModal } from 'components/main/modal';
import { ATTACHMENT_CODE_MODAL_ID } from 'controllers/log/attachments';
import { messages } from './messages';

@withModal(ATTACHMENT_CODE_MODAL_ID)
@injectIntl
@track()
export class AttachmentCodeModal extends Component {
  static propTypes = {
    data: PropTypes.shape({
      extension: PropTypes.string.isRequired,
      content: PropTypes.string.isRequired,
    }).isRequired,
    intl: intlShape.isRequired,
    tracking: PropTypes.shape({
      trackEvent: PropTypes.func,
      getTrackingData: PropTypes.func,
    }).isRequired,
  };

  render() {
    const {
      intl,
      data: { extension, content },
    } = this.props;
    const cancelButton = {
      text: intl.formatMessage(COMMON_LOCALE_KEYS.CLOSE),
      eventInfo: LOG_PAGE_EVENTS.CLOSE_BTN_ATTACHMENT_MODAL,
    };
github reportportal / service-ui / app / src / components / filterEntities / entityItemStatistics.jsx View on Github external
value: CONDITION_EQ,
    label: ,
    shortLabel: ,
  },
];
const messages = defineMessages({
  placeholder: {
    id: 'EntityItemStatistics.placeholder',
    defaultMessage: 'Enter quantity',
  },
});

@injectIntl
export class EntityItemStatistics extends Component {
  static propTypes = {
    intl: intlShape.isRequired,
    value: PropTypes.object.isRequired,
    entityId: PropTypes.string,
    title: PropTypes.string,
    removable: PropTypes.bool,
    onRemove: PropTypes.func,
  };
  static defaultProps = {
    entityId: '',
    title: '',
    removable: true,
    onRemove: () =&gt; {},
  };

  render() {
    const { intl, value, onRemove, removable, entityId, title, ...rest } = this.props;
    return (
github plone / volto / src / components / manage / Sharing / Sharing.jsx View on Github external
}).isRequired,
    pathname: PropTypes.string.isRequired,
    entries: PropTypes.arrayOf(
      PropTypes.shape({
        id: PropTypes.string,
        login: PropTypes.string,
        roles: PropTypes.object,
        title: PropTypes.string,
        type: PropTypes.string,
      }),
    ).isRequired,
    available_roles: PropTypes.arrayOf(PropTypes.object).isRequired,
    inherit: PropTypes.bool,
    title: PropTypes.string.isRequired,
    login: PropTypes.string,
    intl: intlShape.isRequired,
  };

  /**
   * Default properties
   * @property {Object} defaultProps Default properties.
   * @static
   */
  static defaultProps = {
    inherit: null,
    login: '',
  };

  /**
   * Constructor
   * @method constructor
   * @param {Object} props Component properties
github LN-Zap / zap-desktop / app / components / UI / LndConnectionStringInput.js View on Github external
/**
 * @render react
 * @name LndConnectionStringInput
 * @example
 * 
 */
class LndConnectionStringInput extends React.Component {
  static displayName = 'LndConnectionStringInput'

  static propTypes = {
    initialValue: PropTypes.string,
    intl: intlShape.isRequired,
  }

  prettyPrint = json =&gt; {
    try {
      return JSON.stringify(JSON.parse(json), undefined, 4)
    } catch (e) {
      return json
    }
  }

  /**
   * Check for a valid lndconnect uri or BtcPayServer connection string.
   * @param  {String}  value String to validate.
   * @return {Boolean}       Boolean indicating wether the string is a valid or not.
   */
  validate = value =&gt; {