@zwdvidal/react-native-dropdownalert
Version:
A simple alert to notify users about new chat messages, something went wrong or everything is ok.
33 lines (31 loc) • 709 B
JavaScript
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Text } from 'react-native';
export default class Label extends Component {
static propTypes = {
text: PropTypes.string.isRequired,
style: PropTypes.object,
numberOfLines: PropTypes.number,
};
static defaultProps = {
numberOfLines: 1,
style: {
fontSize: 16,
textAlign: 'left',
fontWeight: 'normal',
color: 'white',
backgroundColor: 'transparent',
},
};
render() {
const { text } = this.props;
if (text !== null && text.length > 0) {
return (
<Text {...this.props}>
{text}
</Text>
);
}
return null;
}
}