-
Notifications
You must be signed in to change notification settings - Fork 0
/
ModalBox.js
33 lines (30 loc) · 869 Bytes
/
ModalBox.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import React,{ useState, useEffect }from 'react';
import { Modal, Portal, Text, Button, PaperProvider } from 'react-native-paper';
import { StyleSheet, View } from 'react-native';
const ModalBox = ({data,closeModal,visible}) => {
const hideModal = () => setVisible(false);
return (
<Portal>
<Modal visible={visible} onDismiss={closeModal} contentContainerStyle={styles.container}>
<View style={styles.content}>
<Text style={{color:'black'}}>{data}</Text>
</View>
</Modal>
</Portal>
);
};
const styles = StyleSheet.create({
container: {
justifyContent: 'center',
alignItems: 'center',
},
content: {
backgroundColor: 'white',
padding: 20,
width: 400, height: 400,
justifyContent: 'center',
alignItems: 'center',
borderRadius: 10,
},
});
export default ModalBox;