import React, { useState } from 'react'; import { Text, View } from 'react-native'; import PropTypes from 'prop-types'; import { BorderlessButton, ScrollView } from 'react-native-gesture-handler'; import Modal from 'react-native-modal'; import Markdown, { MarkdownPreview } from '../../containers/markdown'; import { CustomIcon } from '../../lib/Icons'; import { themes } from '../../constants/colors'; import styles from './styles'; const Banner = React.memo( ({ text, title, theme, bannerClosed, closeBanner }) => { const [showModal, openModal] = useState(false); const toggleModal = () => openModal(prevState => !prevState); if (text && !bannerClosed) { return ( <> {title} ); } return null; }, (prevProps, nextProps) => prevProps.text === nextProps.text && prevProps.theme === nextProps.theme && prevProps.bannerClosed === nextProps.bannerClosed ); Banner.propTypes = { text: PropTypes.string, title: PropTypes.string, theme: PropTypes.string, bannerClosed: PropTypes.bool, closeBanner: PropTypes.func }; export default Banner;