UNPKG

1.36 kBJavaScriptView Raw
1import React, { Component } from 'react';
2import { StyleSheet, Text, View, } from 'react-native';
3import PropTypes from 'prop-types';
4import Color from './Color';
5import { StylePropType } from './utils';
6const styles = StyleSheet.create({
7 container: {
8 alignItems: 'center',
9 justifyContent: 'center',
10 flex: 1,
11 marginTop: 5,
12 marginBottom: 10,
13 },
14 text: {
15 backgroundColor: Color.backgroundTransparent,
16 color: Color.defaultColor,
17 fontSize: 12,
18 fontWeight: '300',
19 },
20});
21export default class SystemMessage extends Component {
22 render() {
23 const { currentMessage, containerStyle, wrapperStyle, textStyle, } = this.props;
24 if (currentMessage) {
25 return (<View style={[styles.container, containerStyle]}>
26 <View style={wrapperStyle}>
27 <Text style={[styles.text, textStyle]}>{currentMessage.text}</Text>
28 </View>
29 </View>);
30 }
31 return null;
32 }
33}
34SystemMessage.defaultProps = {
35 currentMessage: {
36 system: false,
37 },
38 containerStyle: {},
39 wrapperStyle: {},
40 textStyle: {},
41};
42SystemMessage.propTypes = {
43 currentMessage: PropTypes.object,
44 containerStyle: StylePropType,
45 wrapperStyle: StylePropType,
46 textStyle: StylePropType,
47};
48//# sourceMappingURL=SystemMessage.js.map
\No newline at end of file