UNPKG

1.14 kBJavaScriptView Raw
1import React 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 function SystemMessage({ currentMessage, containerStyle, wrapperStyle, textStyle, }) {
22 if (currentMessage == null || currentMessage.system == false) {
23 return null;
24 }
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}
31SystemMessage.propTypes = {
32 currentMessage: PropTypes.object,
33 containerStyle: StylePropType,
34 wrapperStyle: StylePropType,
35 textStyle: StylePropType,
36};
37//# sourceMappingURL=SystemMessage.js.map
\No newline at end of file