mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-01-08 21:18:14 -05:00
43 lines
1.1 KiB
TypeScript
43 lines
1.1 KiB
TypeScript
import React from 'react';
|
|
import { Dimensions, StyleSheet } from 'react-native';
|
|
import { Overlay, LinearProgress } from 'react-native-elements';
|
|
import { Column, Text } from './ui';
|
|
import { Colors, elevation } from './ui/styleUtils';
|
|
|
|
const styles = StyleSheet.create({
|
|
overlay: {
|
|
...elevation(5),
|
|
backgroundColor: Colors.White,
|
|
},
|
|
});
|
|
|
|
export const MessageOverlay: React.FC<MessageOverlayProps> = (props) => {
|
|
return (
|
|
<Overlay
|
|
isVisible={props.isVisible}
|
|
overlayStyle={styles.overlay}
|
|
onBackdropPress={props.onBackdropPress}
|
|
>
|
|
<Column padding="24" width={Dimensions.get('screen').width * 0.8}>
|
|
{props.title && (
|
|
<Text weight="semibold" margin="0 0 12 0">
|
|
{props.title}
|
|
</Text>
|
|
)}
|
|
{props.message && <Text margin="0 0 12 0">{props.message}</Text>}
|
|
{props.hasProgress && (
|
|
<LinearProgress variant="indeterminate" color={Colors.Orange} />
|
|
)}
|
|
</Column>
|
|
</Overlay>
|
|
);
|
|
};
|
|
|
|
interface MessageOverlayProps {
|
|
isVisible: boolean;
|
|
title?: string;
|
|
message?: string;
|
|
hasProgress?: boolean;
|
|
onBackdropPress?: () => void;
|
|
}
|