-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcellModalInfo.js
75 lines (68 loc) · 1.67 KB
/
cellModalInfo.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
74
75
'use strict';
var React = require('react-native');
var {
Modal,
Image,
Text,
StyleSheet,
View,
Dimensions,
TouchableHighlight,
TouchableNativeFeedback,
Platform,
} = React;
var imageStyle = {
borderRadius: 2,
backgroundColor: 'black',
width: Dimensions.get('window').width,
height: Dimensions.get('window').height,
resizeMode: 'contain',
};
var cellModalInfo = React.createClass({
render: function(){
var TouchableElement = TouchableHighlight;
if (Platform.OS === 'android') {
TouchableElement = TouchableNativeFeedback;
};
var modalBackgroundStyle = {
backgroundColor: this.props.transparent ? 'rgba(0, 0, 0, 0.5)' : '#f5fcff',
};
var innerContainerTransparentStyle = this.props.transparent
? {backgroundColor: '#fff', padding: 20}
: null;
return (
<Modal
animated={this.props.animated}
transparent={this.props.transparent}
visible={this.props.modalVisible}>
<View style={[styles.container, modalBackgroundStyle]}>
<TouchableElement
onPress={this.props.onPress}
>
<Image style={imageStyle} source={{uri:this.props.image}}/>
</TouchableElement>
</View>
</Modal>
);
},
});
var styles = StyleSheet.create({
container: {
flex: 1,
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
backgroundColor: '#F5FCFF',
},
closeButton: {
color: 'white',
borderWidth: 1,
borderColor: 'white',
padding: 8,
borderRadius: 3,
textAlign: 'center',
marginTop: 10,
alignSelf: 'flex-end',
},
});
module.exports = cellModalInfo;