import React, { FunctionComponent } from 'react'; import { Button, Portal } from 'react-native-paper'; import { ActivityIndicator, StyleSheet, Text, TextStyle, View, ViewStyle, } from 'react-native'; import { Strings } from '../../resources/localization/Strings'; import { IStyledProps } from './types'; interface IProps extends IStyledProps { title?: string; message?: string; cancel?: () => void; showDialog?: boolean; } export interface IPannerStyleProps { container?: ViewStyle; messageText?: TextStyle; titleText?: TextStyle; } export const InProgressDialog: FunctionComponent = ({ title, message, cancel, style, showDialog, }) => { const mergedStyle = { ...defaultStyles, ...style }; const cancelButton = ( ); return showDialog ? ( {title} {message} {cancel ? cancelButton : null} ) : null; }; const defaultStyles = StyleSheet.create({ titleText: { fontSize: 20, fontWeight: 'bold', alignSelf: 'center', }, messageText: { marginTop: 5, alignSelf: 'auto', fontSize: 20, color: 'gray', }, cancelButton: { marginTop: 3, alignSelf: 'center', backgroundColor: '#0086CF', }, dialog: { backgroundColor: 'white', margin: 10, marginStart: 20, marginEnd: 20, padding: 10, alignContent: 'center', borderRadius: 5, }, outside: { flex: 1, width: '100%', }, container: { zIndex: 5, position: 'absolute', flex: 1, alignSelf: 'center', justifyContent: 'center', backgroundColor: '#000000AA', width: '100%', height: '100%', }, });