forked from eyaleizenberg/react-native-custom-action-sheet
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.js
41 lines (37 loc) · 1.1 KB
/
index.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
'use strict';
var React = require('react');
var ReactNative = require('react-native');
var Button = require('./button');
var FadeInView = require('./fade_in_view');
var { Modal, StyleSheet, TouchableOpacity, View } = ReactNative;
var ActionModal = React.createClass({
render: function() {
return (
<FadeInView visible={this.props.modalVisible} backgroundColor={this.props.backgroundColor}>
<Modal
animationType="slide"
transparent={true}
visible={this.props.modalVisible}
onRequestClose={this.props.onCancel}>
<View style={styles.modalContainer}>
<TouchableOpacity style={styles.container} onPress={this.props.onCancel}></TouchableOpacity>
{this.props.children}
<Button onPress={this.props.onCancel} text={this.props.buttonText || "Cancel"} />
</View>
</Modal>
</FadeInView>
);
}
});
var styles = StyleSheet.create({
container: {
flex: 1
},
modalContainer: {
flex: 1,
padding: 8,
paddingBottom: 0,
justifyContent: "flex-end"
}
});
module.exports = ActionModal;