comment links issue, wip

This commit is contained in:
feruz 2020-01-20 17:06:42 +02:00
parent 35759e14e5
commit 02b6abff7a
5 changed files with 14 additions and 7 deletions

View File

@ -53,7 +53,7 @@
"react-intl": "^3.9.2",
"react-native": "0.61.5",
"react-native-actionsheet": "esteemapp/react-native-actionsheet",
"react-native-autoheight-webview": "^1.3.4",
"react-native-autoheight-webview": "^1.4.0",
"react-native-code-push": "esteemapp/react-native-code-push",
"react-native-config": "luggit/react-native-config#master",
"react-native-dark-mode": "^0.2.1",

View File

@ -326,18 +326,18 @@ const CommentBody = ({
</Modal>
<AutoHeightWebView
key={created.toString()}
source={{
html: html,
}}
source={{ html }}
allowsFullscreenVideo={true}
style={{ width: WIDTH - (32 + 34 * (commentDepth % 6)) }}
customStyle={customStyle}
onMessage={__handleOnLinkPress}
renderLoading={() => <CommentPlaceHolder />}
customScript={customBodyScript}
renderLoading={() => <CommentPlaceHolder />}
startInLoadingState={true}
onShouldStartLoadWithRequest={false}
scrollEnabled={false}
scalesPageToFit={false}
zoomable={false}
/>
</Fragment>
);

View File

@ -1,7 +1,6 @@
'use strict';
const customBodyScript = `
setTimeout(function() {
var images = document.getElementsByTagName("IMG");
for (i = 0; i < images.length; i++) {
var result = {
@ -119,7 +118,6 @@ document.addEventListener('click', function(event) {
var author = el.getAttribute('data-author').toString();
window.ReactNativeWebView.postMessage(JSON.stringify(author));
})
}, 300);
true;
`;

View File

@ -330,6 +330,8 @@ const PostBody = ({
startInLoadingState={true}
onShouldStartLoadWithRequest={false}
scrollEnabled={false}
scalesPageToFit={false}
zoomable={false}
/>
</Fragment>
);

View File

@ -7562,6 +7562,13 @@ react-native-autoheight-webview@^1.3.4:
dependencies:
prop-types "^15.7.2"
react-native-autoheight-webview@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/react-native-autoheight-webview/-/react-native-autoheight-webview-1.4.0.tgz#03274b8cd5d2e4fdf25511f10cfe3321864460a0"
integrity sha512-JhyzEL5eAKPN2VtbA6kL6f3Zphmmx1XcEnIluE+Fed3iwQxXJ1GwrvQb+ENGTZhDKtTdh39sfqadpm+2/h9V0A==
dependencies:
prop-types "^15.7.2"
react-native-code-push@esteemapp/react-native-code-push:
version "1000.0.0-beta"
resolved "https://codeload.github.com/esteemapp/react-native-code-push/tar.gz/c07b7023c1212dc5d9231a0526a869d2501cb221"