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({
174174 paddingLeft : 20 ,
175175 borderLeftColor : '#3498DB' ,
176176 borderLeftWidth : 3
177+ } ,
178+ img :{
179+ width : width - 80 ,
180+ height : width - 80 ,
181+ resizeMode : Image . resizeMode . contain
177182 }
178183} )
179184
Original file line number Diff line number Diff line change @@ -83,6 +83,9 @@ class HtmlContent extends Component {
8383
8484 _renderNode ( node , index , parent , type ) {
8585 var name = node . name
86+
87+ var imgStyle = ( this . props . style && this . props . style . img ) || styles . img
88+
8689 if ( node . type == 'block' && type == 'block' ) {
8790 if ( name == 'img' ) {
8891 var uri = node . attribs . src ;
@@ -94,7 +97,7 @@ class HtmlContent extends Component {
9497 < Image
9598 key = { index }
9699 source = { { uri :uri } }
97- style = { styles . img } >
100+ style = { imgStyle } >
98101 </ Image >
99102 )
100103 }
@@ -108,7 +111,7 @@ class HtmlContent extends Component {
108111 value = { this . props . content }
109112 stylesheet = { this . props . style }
110113 onLinkPress = { this . _onLinkPress . bind ( this ) }
111- renderNode = { this . _renderNode }
114+ renderNode = { this . _renderNode . bind ( this ) }
112115 />
113116 )
114117 }
You can’t perform that action at this time.
0 commit comments