mattermost-mobile/app/components/formatted_text.js
enahum 79902e8ceb Mfa (#182)
* Adding MFA support

* specific actions on mfa

* Fix header on new navigation

* review feedback
2017-01-24 16:08:09 -05:00

39 lines
887 B
JavaScript

// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import React, {Component, PropTypes} from 'react';
import {Text} from 'react-native';
import {injectIntl, intlShape} from 'react-intl';
class FormattedText extends Component {
static propTypes = {
intl: intlShape.isRequired,
id: PropTypes.string.isRequired,
defaultMessage: PropTypes.string,
values: PropTypes.object
};
static defaultProps = {
defaultMessage: ''
};
render() {
const {
id,
defaultMessage,
values,
intl,
...props
} = this.props;
return (
<Text {...props}>
{intl.formatMessage({id, defaultMessage}, values)}
</Text>
);
}
}
export default injectIntl(FormattedText);