mirror of
https://github.com/status-im/react-native.git
synced 2025-01-14 03:26:07 +00:00
[ReactNative] s/render*View/render/ in <WebView>
This commit is contained in:
parent
afb71ae1c3
commit
4b42f8c9e9
@ -81,8 +81,8 @@ var WebViewExample = React.createClass({
|
||||
automaticallyAdjustContentInsets={false}
|
||||
style={styles.webView}
|
||||
url={this.state.url}
|
||||
renderErrorView={this.renderErrorView}
|
||||
renderLoadingView={this.renderLoadingView}
|
||||
renderError={this.renderError}
|
||||
renderLoading={this.renderLoading}
|
||||
onNavigationStateChange={this.onNavigationStateChange}
|
||||
startInLoadingState={true}
|
||||
/>
|
||||
@ -115,7 +115,7 @@ var WebViewExample = React.createClass({
|
||||
});
|
||||
},
|
||||
|
||||
renderErrorView: function(errorDomain, errorCode, errorDesc) {
|
||||
renderError: function(errorDomain, errorCode, errorDesc) {
|
||||
return (
|
||||
<View style={styles.errorContainer}>
|
||||
<Text style={styles.errorTextTitle}>
|
||||
@ -134,7 +134,7 @@ var WebViewExample = React.createClass({
|
||||
);
|
||||
},
|
||||
|
||||
renderLoadingView: function() {
|
||||
renderLoading: function() {
|
||||
return (
|
||||
<View style={styles.loadingView}>
|
||||
<ActivityIndicatorIOS />
|
||||
|
@ -29,8 +29,8 @@ var WebViewState = keyMirror({
|
||||
var WebView = React.createClass({
|
||||
|
||||
propTypes: {
|
||||
renderErrorView: PropTypes.func.isRequired, // view to show if there's an error
|
||||
renderLoadingView: PropTypes.func.isRequired, // loading indicator to show
|
||||
renderError: PropTypes.func.isRequired, // view to show if there's an error
|
||||
renderLoading: PropTypes.func.isRequired, // loading indicator to show
|
||||
url: PropTypes.string.isRequired,
|
||||
automaticallyAdjustContentInsets: PropTypes.bool,
|
||||
contentInset: EdgeInsetsPropType,
|
||||
@ -61,10 +61,10 @@ var WebView = React.createClass({
|
||||
var otherView = null;
|
||||
|
||||
if (this.state.viewState === WebViewState.LOADING) {
|
||||
otherView = this.props.renderLoadingView();
|
||||
otherView = this.props.renderLoading();
|
||||
} else if (this.state.viewState === WebViewState.ERROR) {
|
||||
var errorEvent = this.state.lastErrorEvent;
|
||||
otherView = this.props.renderErrorView(
|
||||
otherView = this.props.renderError(
|
||||
errorEvent.domain,
|
||||
errorEvent.code,
|
||||
errorEvent.description);
|
||||
|
@ -42,8 +42,8 @@ var WebView = React.createClass({
|
||||
},
|
||||
|
||||
propTypes: {
|
||||
renderErrorView: PropTypes.func.isRequired, // view to show if there's an error
|
||||
renderLoadingView: PropTypes.func.isRequired, // loading indicator to show
|
||||
renderError: PropTypes.func.isRequired, // view to show if there's an error
|
||||
renderLoading: PropTypes.func.isRequired, // loading indicator to show
|
||||
url: PropTypes.string.isRequired,
|
||||
automaticallyAdjustContentInsets: PropTypes.bool,
|
||||
shouldInjectAJAXHandler: PropTypes.bool,
|
||||
@ -71,10 +71,10 @@ var WebView = React.createClass({
|
||||
var otherView = null;
|
||||
|
||||
if (this.state.viewState === WebViewState.LOADING) {
|
||||
otherView = this.props.renderLoadingView();
|
||||
otherView = this.props.renderLoading();
|
||||
} else if (this.state.viewState === WebViewState.ERROR) {
|
||||
var errorEvent = this.state.lastErrorEvent;
|
||||
otherView = this.props.renderErrorView(
|
||||
otherView = this.props.renderError(
|
||||
errorEvent.domain,
|
||||
errorEvent.code,
|
||||
errorEvent.description);
|
||||
|
Loading…
x
Reference in New Issue
Block a user