-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathPopup.js
73 lines (68 loc) · 1.48 KB
/
Popup.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import React, {Component} from 'react';
import {
StyleSheet,
View,
TouchableWithoutFeedback,
Modal as NativeModal,
} from 'react-native';
import colors from 'assets/colors';
import PropTypes from 'prop-types';
class Popup extends Component {
render() {
const {visible} = this.props;
return (
<NativeModal
visible={visible}
transparent
animationType="none"
onRequestClose={this.handleOnPressOverlay}>
<TouchableWithoutFeedback>
<View style={styles.overlay} />
</TouchableWithoutFeedback>
<View style={styles.container}>{this.props.children}</View>
</NativeModal>
);
}
}
Popup.propTypes = {
visible: PropTypes.bool.isRequired,
};
const styles = StyleSheet.create({
status_bar: {
backgroundColor: 'white',
},
header: {
flexDirection: 'row',
backgroundColor: 'white',
paddingVertical: 15,
paddingHorizontal: 10,
borderBottomWidth: 1,
borderBottomColor: colors.card_border,
alignItems: 'center',
justifyContent: 'space-between',
},
title_wrapper: {
flexDirection: 'row',
alignItems: 'center',
},
title: {
paddingLeft: 20,
fontSize: 24,
color: colors.section_title,
fontWeight: '500',
},
container: {
flex: 1,
justifyContent: 'center',
margin: '5%',
},
overlay: {
position: 'absolute',
top: 0,
bottom: 0,
left: 0,
right: 0,
backgroundColor: 'rgba(0,0,0,0.3)',
},
});
export default Popup;