1 | import React from 'react';
|
2 | import { StyleSheet, Text, View, } from 'react-native';
|
3 | import PropTypes from 'prop-types';
|
4 | import Color from './Color';
|
5 | import { StylePropType } from './utils';
|
6 | const 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 | });
|
21 | export 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 | }
|
31 | SystemMessage.propTypes = {
|
32 | currentMessage: PropTypes.object,
|
33 | containerStyle: StylePropType,
|
34 | wrapperStyle: StylePropType,
|
35 | textStyle: StylePropType,
|
36 | };
|
37 |
|
\ | No newline at end of file |