mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-17 10:21:33 +03:00
Merge branch 'development' of https://github.com/ecency/ecency-mobile into sa/fix-usenativedriver-warnings
This commit is contained in:
commit
1125ab99bc
@ -1,4 +1,4 @@
|
||||
import React, { memo } from 'react';
|
||||
import React, { memo, useMemo } from 'react';
|
||||
import RenderHTML, { CustomRendererProps, Element, TNode } from 'react-native-render-html';
|
||||
import styles from './postHtmlRendererStyles';
|
||||
import { LinkData, parseLinkData } from './linkDataParser';
|
||||
@ -328,18 +328,8 @@ export const PostHtmlRenderer = memo(
|
||||
|
||||
};
|
||||
|
||||
return (
|
||||
<RenderHTML
|
||||
source={{ html: body }}
|
||||
contentWidth={contentWidth}
|
||||
baseStyle={{ ...styles.baseStyle, width: contentWidth }}
|
||||
classesStyles={{
|
||||
phishy: styles.phishy,
|
||||
'text-justify': styles.textJustify,
|
||||
'text-center': styles.textCenter,
|
||||
}}
|
||||
tagsStyles={{
|
||||
body: styles.body,
|
||||
const tagsStyles = useMemo(
|
||||
() => ({
|
||||
a: styles.a,
|
||||
img: styles.img,
|
||||
table: styles.table,
|
||||
@ -352,32 +342,85 @@ export const PostHtmlRenderer = memo(
|
||||
li: styles.li,
|
||||
p: styles.p,
|
||||
h6: styles.h6
|
||||
}}
|
||||
domVisitors={{
|
||||
onElement: _onElement,
|
||||
}}
|
||||
renderers={{
|
||||
}),
|
||||
[contentWidth]
|
||||
);
|
||||
|
||||
const baseStyle = useMemo(
|
||||
() => (
|
||||
{ ...styles.baseStyle, width: contentWidth }
|
||||
),
|
||||
[contentWidth]
|
||||
);
|
||||
|
||||
const classesStyles = useMemo(
|
||||
() => (
|
||||
{
|
||||
phishy: styles.phishy,
|
||||
'text-justify': styles.textJustify,
|
||||
'text-center': styles.textCenter,
|
||||
}
|
||||
),
|
||||
[],
|
||||
);
|
||||
|
||||
const renderers = useMemo(
|
||||
() => (
|
||||
{
|
||||
img: _imageRenderer,
|
||||
a: _anchorRenderer,
|
||||
p: _paraRenderer,
|
||||
iframe: _iframeRenderer,
|
||||
table: _tableRenderer
|
||||
}}
|
||||
} as any
|
||||
),
|
||||
[],
|
||||
);
|
||||
|
||||
const domVisitors = useMemo(
|
||||
() => (
|
||||
{
|
||||
onElement: _onElement,
|
||||
}
|
||||
),
|
||||
[],
|
||||
);
|
||||
|
||||
const customHTMLElementModels = useMemo(
|
||||
() => (
|
||||
{
|
||||
iframe: iframeModel,
|
||||
}
|
||||
),
|
||||
[],
|
||||
);
|
||||
|
||||
const renderersProps = useMemo(
|
||||
() => (
|
||||
{
|
||||
iframe: {
|
||||
scalesPageToFit: true
|
||||
},
|
||||
}
|
||||
),
|
||||
[],
|
||||
);
|
||||
|
||||
return (
|
||||
<RenderHTML
|
||||
source={{ html: body }}
|
||||
contentWidth={contentWidth}
|
||||
baseStyle={baseStyle}
|
||||
classesStyles={classesStyles}
|
||||
tagsStyles={tagsStyles}
|
||||
domVisitors={domVisitors}
|
||||
renderers={renderers}
|
||||
onHTMLLoaded={onLoaded && onLoaded}
|
||||
defaultTextProps={{
|
||||
selectable: true,
|
||||
}}
|
||||
customHTMLElementModels={{
|
||||
iframe: iframeModel,
|
||||
}}
|
||||
renderersProps={{
|
||||
iframe: {
|
||||
scalesPageToFit: true,
|
||||
webViewProps: {
|
||||
/* Any prop you want to pass to iframe WebViews */
|
||||
},
|
||||
},
|
||||
}}
|
||||
customHTMLElementModels={customHTMLElementModels}
|
||||
renderersProps={renderersProps}
|
||||
WebView={WebView}
|
||||
/>
|
||||
);
|
||||
|
@ -271,9 +271,11 @@ class LoginContainer extends PureComponent {
|
||||
};
|
||||
|
||||
render() {
|
||||
const { navigation } = this.props;
|
||||
const { isLoading } = this.state;
|
||||
return (
|
||||
<LoginScreen
|
||||
navigation={navigation}
|
||||
handleOnPressLogin={this._handleOnPressLogin}
|
||||
getAccountsWithUsername={this._getAccountsWithUsername}
|
||||
handleSignUp={this._handleSignUp}
|
||||
|
@ -4,7 +4,6 @@ import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view
|
||||
import ScrollableTabView from 'react-native-scrollable-tab-view';
|
||||
import { injectIntl } from 'react-intl';
|
||||
import { debounce } from 'lodash';
|
||||
import { withNavigation } from '@react-navigation/compat';
|
||||
|
||||
// Actions
|
||||
import HiveSigner from '../../steem-connect/hiveSigner';
|
||||
@ -218,4 +217,4 @@ class LoginScreen extends PureComponent {
|
||||
}
|
||||
}
|
||||
|
||||
export default withNavigation(injectIntl(LoginScreen));
|
||||
export default injectIntl(LoginScreen);
|
||||
|
Loading…
Reference in New Issue
Block a user