This repository was archived by the owner on Jan 3, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
app/components/htmlRender Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -174,6 +174,11 @@ var styles = StyleSheet.create({
174
174
paddingLeft : 20 ,
175
175
borderLeftColor : '#3498DB' ,
176
176
borderLeftWidth : 3
177
+ } ,
178
+ img :{
179
+ width : width - 80 ,
180
+ height : width - 80 ,
181
+ resizeMode : Image . resizeMode . contain
177
182
}
178
183
} )
179
184
Original file line number Diff line number Diff line change @@ -83,6 +83,9 @@ class HtmlContent extends Component {
83
83
84
84
_renderNode ( node , index , parent , type ) {
85
85
var name = node . name
86
+
87
+ var imgStyle = ( this . props . style && this . props . style . img ) || styles . img
88
+
86
89
if ( node . type == 'block' && type == 'block' ) {
87
90
if ( name == 'img' ) {
88
91
var uri = node . attribs . src ;
@@ -94,7 +97,7 @@ class HtmlContent extends Component {
94
97
< Image
95
98
key = { index }
96
99
source = { { uri :uri } }
97
- style = { styles . img } >
100
+ style = { imgStyle } >
98
101
</ Image >
99
102
)
100
103
}
@@ -108,7 +111,7 @@ class HtmlContent extends Component {
108
111
value = { this . props . content }
109
112
stylesheet = { this . props . style }
110
113
onLinkPress = { this . _onLinkPress . bind ( this ) }
111
- renderNode = { this . _renderNode }
114
+ renderNode = { this . _renderNode . bind ( this ) }
112
115
/>
113
116
)
114
117
}
You can’t perform that action at this time.
0 commit comments