Skip to content

Add deprecated-react-native-prop-types change ViewPropTypes #346

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
0bc4689
Add deprecated-react-native-prop-types change ViewPropTypes
jeffersongoncalves Jul 20, 2022
f57ebe8
Bump semver from 5.7.0 to 5.7.2
dependabot[bot] Jul 12, 2023
23c8bab
Merge pull request #1 from jeffersonsimaogoncalves/dependabot/npm_and…
jeffersongoncalves Aug 15, 2023
47751e0
Bump ua-parser-js from 0.7.20 to 0.7.35
dependabot[bot] Aug 15, 2023
72ee14d
Bump minimatch from 3.0.4 to 3.1.2
dependabot[bot] Aug 15, 2023
7bb9b29
Bump decode-uri-component from 0.2.0 to 0.2.2
dependabot[bot] Aug 15, 2023
7ab3c4e
Bump qs from 6.5.2 to 6.5.3
dependabot[bot] Aug 15, 2023
c289a6d
Merge pull request #5 from jeffersonsimaogoncalves/dependabot/npm_and…
jeffersongoncalves Aug 18, 2023
0c594bf
Merge pull request #4 from jeffersonsimaogoncalves/dependabot/npm_and…
jeffersongoncalves Aug 18, 2023
03d74c2
Merge pull request #3 from jeffersonsimaogoncalves/dependabot/npm_and…
jeffersongoncalves Aug 18, 2023
fe42416
Merge pull request #2 from jeffersonsimaogoncalves/dependabot/npm_and…
jeffersongoncalves Aug 18, 2023
3a07e62
Bump async from 2.6.3 to 2.6.4
dependabot[bot] Aug 18, 2023
62c8615
Merge pull request #6 from jeffersonsimaogoncalves/dependabot/npm_and…
jeffersongoncalves Aug 18, 2023
ea871e3
Bump fsevents from 1.2.9 to 1.2.13
dependabot[bot] Oct 10, 2023
12da79c
Merge pull request #7 from jeffersonsimaogoncalves/dependabot/npm_and…
jeffersongoncalves Oct 10, 2023
974b547
Bump @babel/traverse from 7.5.5 to 7.23.2
dependabot[bot] Oct 19, 2023
8c62cc9
Merge pull request #8 from jeffersonsimaogoncalves/dependabot/npm_and…
jeffersongoncalves Oct 20, 2023
f77229c
Bump lodash from 4.17.15 to 4.17.21
dependabot[bot] Oct 25, 2023
ed043fc
Merge pull request #9 from jeffersonsimaogoncalves/dependabot/npm_and…
jeffersongoncalves Oct 26, 2023
5d7609c
Bump handlebars from 4.1.2 to 4.7.8
dependabot[bot] Nov 28, 2023
26ce26c
Merge pull request #10 from jeffersonsimaogoncalves/dependabot/npm_an…
jeffersongoncalves Nov 28, 2023
65c02ca
Bump the npm_and_yarn group across 1 directory with 7 updates
dependabot[bot] Jun 11, 2024
a42ff43
Merge pull request #11 from jeffersonsimaogoncalves/dependabot/npm_an…
jeffersongoncalves Jun 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 19 additions & 18 deletions HTMLView.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import React, {PureComponent} from 'react';
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import htmlToElement from './htmlToElement';
import {Linking, Platform, StyleSheet, View, ViewPropTypes} from 'react-native';
import { Linking, Platform, StyleSheet, View } from 'react-native';
import { ViewPropTypes } from 'deprecated-react-native-prop-types';

const boldStyle = {fontWeight: 'bold'};
const italicStyle = {fontStyle: 'italic'};
const underlineStyle = {textDecorationLine: 'underline'};
const strikethroughStyle = {textDecorationLine: 'line-through'};
const codeStyle = {fontFamily: Platform.OS === 'ios' ? 'Menlo' : 'monospace'};
const boldStyle = { fontWeight: 'bold' };
const italicStyle = { fontStyle: 'italic' };
const underlineStyle = { textDecorationLine: 'underline' };
const strikethroughStyle = { textDecorationLine: 'line-through' };
const codeStyle = { fontFamily: Platform.OS === 'ios' ? 'Menlo' : 'monospace' };

const baseStyles = StyleSheet.create({
b: boldStyle,
Expand All @@ -23,12 +24,12 @@ const baseStyles = StyleSheet.create({
fontWeight: 'bold',
color: '#007AFF',
},
h1: {fontWeight: 'bold', fontSize: 36},
h2: {fontWeight: 'bold', fontSize: 30},
h3: {fontWeight: 'bold', fontSize: 24},
h4: {fontWeight: 'bold', fontSize: 18},
h5: {fontWeight: 'bold', fontSize: 14},
h6: {fontWeight: 'bold', fontSize: 12},
h1: { fontWeight: 'bold', fontSize: 36 },
h2: { fontWeight: 'bold', fontSize: 30 },
h3: { fontWeight: 'bold', fontSize: 24 },
h4: { fontWeight: 'bold', fontSize: 18 },
h5: { fontWeight: 'bold', fontSize: 14 },
h6: { fontWeight: 'bold', fontSize: 12 },
});

const htmlToElementOptKeys = [
Expand Down Expand Up @@ -75,14 +76,14 @@ class HtmlView extends PureComponent {
} = this.props;

if (!value) {
this.setState({element: null});
this.setState({ element: null });
}

const opts = {
addLineBreaks,
linkHandler: onLinkPress,
linkLongPressHandler: onLinkLongPress,
styles: {...baseStyles, ...stylesheet, ...style},
styles: { ...baseStyles, ...stylesheet, ...style },
customRenderer: renderNode,
};

Expand All @@ -106,14 +107,14 @@ class HtmlView extends PureComponent {
}

if (this.mounted) {
this.setState({element});
this.setState({ element });
}
});
}

render() {
const {RootComponent, style} = this.props;
const {element} = this.state;
const { RootComponent, style } = this.props;
const { element } = this.state;
if (element) {
return (
<RootComponent
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"url": "git://github.com/jsdf/react-native-htmlview.git"
},
"dependencies": {
"deprecated-react-native-prop-types": "^2.3.0",
"entities": "^1.1.1",
"htmlparser2-without-node-native": "^3.9.2"
}
Expand Down
Loading