Merge pull request #2325 from BlueWallet/hodlhodlwebviewhooks

REF: HodlHodlWebView Hooks
This commit is contained in:
GLaDOS 2020-12-11 11:26:13 +00:00 committed by GitHub
commit 0481a476b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,27 +1,18 @@
import React, { Component } from 'react';
import React from 'react';
import { WebView } from 'react-native-webview';
import { BlueNavigationStyle, SafeBlueArea } from '../../BlueComponents';
import PropTypes from 'prop-types';
import { useRoute } from '@react-navigation/native';
export default class HodlHodlWebview extends Component {
constructor(props) {
super(props);
const HodlHodlWebview = () => {
const { uri } = useRoute().params;
const uri = props.route.params.uri;
this.state = {
uri,
};
}
render() {
return (
<SafeBlueArea>
<WebView source={{ uri: this.state.uri }} incognito />
</SafeBlueArea>
);
}
}
return (
<SafeBlueArea>
<WebView source={{ uri }} incognito />
</SafeBlueArea>
);
};
HodlHodlWebview.propTypes = {
route: PropTypes.shape({
@ -31,6 +22,8 @@ HodlHodlWebview.propTypes = {
}),
};
export default HodlHodlWebview;
HodlHodlWebview.navigationOptions = ({ navigation }) => ({
...BlueNavigationStyle(navigation, true),
title: '',