import React from 'react'; import { Text, TouchableHighlight, View } from 'react-native'; import Modal from '../modal/ModalView'; import PopupMixin from './PopupMixin'; const getModal = (props: any, visible: any, { getContent, hide, onDismiss, onOk }: any) => { const { styles, title, okText, dismissText } = props; const titleEl = typeof title === 'string' ? ( {title} ) : ( title ); const okEl = typeof okText === 'string' ? ( {okText} ) : ( okText ); const dismissEl = typeof dismissText === 'string' ? ( {dismissText} ) : ( dismissText ); return ( {dismissEl} {titleEl} {okEl} {getContent()} ); }; export default PopupMixin(getModal, { actionTextUnderlayColor: '#ddd', actionTextActiveOpacity: 1, triggerType: 'onPress', styles: {}, WrapComponent: View as any, });