|
@@ -52,23 +52,43 @@ export default class SingleImage extends React.Component { |
|
@@ -52,23 +52,43 @@ export default class SingleImage extends React.Component { |
52
|
let {resource} = this.props;
|
52
|
let {resource} = this.props;
|
53
|
let template_name = resource.get('data');
|
53
|
let template_name = resource.get('data');
|
54
|
let src = template_name.get('src');
|
54
|
let src = template_name.get('src');
|
|
|
55
|
+ let linkUrl = template_name.get('url');
|
55
|
let imageHeight = template_name.get('height');
|
56
|
let imageHeight = template_name.get('height');
|
56
|
let imageWidth = template_name.get('width');
|
57
|
let imageWidth = template_name.get('width');
|
57
|
|
58
|
|
58
|
if (imageHeight && imageWidth) {
|
59
|
if (imageHeight && imageWidth) {
|
59
|
return (
|
60
|
return (
|
60
|
- <Image
|
|
|
61
|
- source={{uri: src}}
|
|
|
62
|
- style={{width: screenWidth,height: (imageHeight/imageWidth)*screenWidth}}
|
|
|
63
|
- />
|
|
|
64
|
- );
|
61
|
+ <View style={{width: screenWidth,height: (imageHeight/imageWidth)*screenWidth}}>
|
|
|
62
|
+ {linkUrl?<TouchableOpacity activeOpacity={0.5} onPress={() => {
|
|
|
63
|
+ this.props.onPressLink && this.props.onPressLink(linkUrl);
|
|
|
64
|
+ }}>
|
|
|
65
|
+ <Image
|
|
|
66
|
+ source={{uri: src}}
|
|
|
67
|
+ style={{width: screenWidth,height: (imageHeight/imageWidth)*screenWidth}}
|
|
|
68
|
+ />
|
|
|
69
|
+ </TouchableOpacity>:<Image
|
|
|
70
|
+ source={{uri: src}}
|
|
|
71
|
+ style={{width: screenWidth,height: (imageHeight/imageWidth)*screenWidth}}
|
|
|
72
|
+ />}
|
|
|
73
|
+ </View>
|
|
|
74
|
+ );
|
65
|
}else {
|
75
|
}else {
|
66
|
return (
|
76
|
return (
|
67
|
- <Image
|
|
|
68
|
- ref={(ref)=>this.imageView=ref}
|
|
|
69
|
- source={{uri: src}}
|
|
|
70
|
- style={{width: screenWidth,height: (this.state.height/this.state.width)*screenWidth}}
|
|
|
71
|
- />
|
77
|
+ <View style={{width: screenWidth,height: (this.state.height/this.state.width)*screenWidth}}>
|
|
|
78
|
+ {linkUrl?<TouchableOpacity activeOpacity={0.5} onPress={() => {
|
|
|
79
|
+ this.props.onPressLink && this.props.onPressLink(linkUrl);
|
|
|
80
|
+ }}>
|
|
|
81
|
+ <Image
|
|
|
82
|
+ ref={(ref)=>this.imageView=ref}
|
|
|
83
|
+ source={{uri: src}}
|
|
|
84
|
+ style={{width: screenWidth,height: (this.state.height/this.state.width)*screenWidth}}
|
|
|
85
|
+ />
|
|
|
86
|
+ </TouchableOpacity>:<Image
|
|
|
87
|
+ ref={(ref)=>this.imageView=ref}
|
|
|
88
|
+ source={{uri: src}}
|
|
|
89
|
+ style={{width: screenWidth,height: (this.state.height/this.state.width)*screenWidth}}
|
|
|
90
|
+ />}
|
|
|
91
|
+ </View>
|
72
|
);
|
92
|
);
|
73
|
}
|
93
|
}
|
74
|
}
|
94
|
}
|