Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,37 +1,32 @@
import React from 'react';
import {View} from 'react-native';
import PropTypes from 'prop-types';
import styles from '../styles/styles';
import theme from '../styles/themes/default';
import Text from './Text';
import * as Expensicons from './Icon/Expensicons';
import Icon from './Icon';

const propTypes = {
type InlineSystemMessageProps = {
/** Error to display */
message: PropTypes.string,
message?: string;
};

const defaultProps = {
message: '',
};

function InlineSystemMessage(props) {
if (props.message.length === 0) {
function InlineSystemMessage({message = ''}: InlineSystemMessageProps) {
if (!message) {
return null;
}

return (
<View style={[styles.flexRow, styles.alignItemsCenter]}>
<Icon
src={Expensicons.Exclamation}
fill={theme.danger}
/>
<Text style={[styles.inlineSystemMessage]}>{props.message}</Text>
<Text style={styles.inlineSystemMessage}>{message}</Text>
</View>
);
}

InlineSystemMessage.propTypes = propTypes;
InlineSystemMessage.defaultProps = defaultProps;
InlineSystemMessage.displayName = 'InlineSystemMessage';

export default InlineSystemMessage;