mattermost-mobile/app/components/error_text.js
enahum e2f3f7b803 project folder structure (#107)
* project folder structure

* Moving store to be called from app folder
2016-12-09 10:34:17 -05:00

27 lines
667 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 {GlobalStyles} from 'app/styles';
const propTypes = {
error: PropTypes.oneOfType([PropTypes.string, PropTypes.object])
};
export default class ErrorText extends Component {
static propTypes = propTypes;
render() {
if (!this.props.error) {
return null;
}
return (
<Text style={GlobalStyles.errorLabel}>
{this.props.error.message || this.props.error}
</Text>
);
}
}