diff --git a/app/components/StatusBox.js b/app/components/StatusBox.js index 094cb43..d39faf2 100644 --- a/app/components/StatusBox.js +++ b/app/components/StatusBox.js @@ -1,38 +1,38 @@ import React, { useState } from 'react'; import PropTypes from 'prop-types'; import { Snackbar } from 'react-native-paper'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; import styles from '../assets/styles/blink/_StatusBox.scss'; const StatusBox = (props) => { const [visible, setVisible] = useState(true); let iconName; switch (props.level) { case 'info': iconName = 'information-outline'; break; case 'danger': iconName = 'alert-circle-outline'; break; case 'warning': iconName = 'alert-octogon-outline'; break; } return ( - { setVisible(false) }} icon={iconName}> - { props.title }{ props.message } + { setVisible(false) }}> + { iconName ? () : null }{ props.title }{ props.message } ); }; StatusBox.propTypes = { level: PropTypes.string, message: PropTypes.string.isRequired, title: PropTypes.string, }; export default StatusBox;