Skip to content

Commit 94d1233

Browse files
committed
feat(HTML): set staticContentMaxWidth & imagesMaxWidth as your device width by default
Since most users pass these manually everytime they use the plugin, let’s set those as the default value for these props. Moreoever, they serve as a nice fallback for the iframe renderer.
1 parent 06297c1 commit 94d1233

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/HTML.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { PureComponent } from 'react';
22
import PropTypes from 'prop-types';
3-
import { View, Text, ViewPropTypes, ActivityIndicator } from 'react-native';
3+
import { View, Text, ViewPropTypes, ActivityIndicator, Dimensions } from 'react-native';
44
import { BLOCK_TAGS, TEXT_TAGS, MIXED_TAGS, IGNORED_TAGS, TEXT_TAGS_IGNORING_ASSOCIATION, STYLESETS, TextOnlyPropTypes } from './HTMLUtils';
55
import { cssStringToRNStyle, _getElementClassStyles, cssStringToObject, cssObjectToString } from './HTMLStyles';
66
import { generateDefaultBlockStyles, generateDefaultTextStyles } from './HTMLDefaultStyles';
@@ -46,6 +46,8 @@ export default class HTML extends PureComponent {
4646
decodeEntities: true,
4747
emSize: 14,
4848
ptSize: 1.3,
49+
staticContentMaxWidth: Dimensions.get('window').width,
50+
imagesMaxWidth: Dimensions.get('window').width,
4951
ignoredTags: IGNORED_TAGS,
5052
ignoredStyles: [],
5153
baseFontStyle: { fontSize: 14 },

0 commit comments

Comments
 (0)