diff --git a/src/components/Custom/CustomHTML.js b/src/components/Custom/CustomHTML.js index 1e3aa54..7d88d1f 100644 --- a/src/components/Custom/CustomHTML.js +++ b/src/components/Custom/CustomHTML.js @@ -1,6 +1,5 @@ import * as React from 'react'; -import {View} from "react-native"; -import {withTheme} from 'react-native-paper'; +import {Text, withTheme} from 'react-native-paper'; import HTML from "react-native-render-html"; import {Linking} from "expo"; @@ -18,26 +17,21 @@ class CustomHTML extends React.Component { Linking.openURL(link).catch((err) => console.error('Error opening link', err)); }; - getHTML() { - // Surround description with div to allow text styling if the description is not html - return " + this.props.html + ""} - tagsStyles={{ - p: {color: this.props.theme.colors.text}, - div: {color: this.props.theme.colors.text} - }} - onLinkPress={this.openWebLink}/>; - } + getBasicText = (htmlAttribs, children, convertedCSSStyles, passProps) => { + // console.log(convertedCSSStyles); + return {children}; + }; render() { - // Completely recreate the component on theme change to force theme reload - if (this.props.theme.dark) - return ( - - {this.getHTML()} - - ); - else - return this.getHTML(); + // Surround description with p to allow text styling if the description is not html + return " + this.props.html + "

"} + renderers={{ + p: this.getBasicText, + }} + ignoredStyles={['color', 'background-color']} + + onLinkPress={this.openWebLink}/>; } }