|
@@ -1,6 +1,6 @@
|
1
|
1
|
// @flow
|
2
|
2
|
|
3
|
|
-import React, { Component } from 'react';
|
|
3
|
+import React, { PureComponent } from 'react';
|
4
|
4
|
import { Linking, Platform, View } from 'react-native';
|
5
|
5
|
import { WebView } from 'react-native-webview';
|
6
|
6
|
import { type Dispatch } from 'redux';
|
|
@@ -13,8 +13,6 @@ import { LoadingIndicator } from '../../../../base/react';
|
13
|
13
|
import { connect } from '../../../../base/redux';
|
14
|
14
|
import HeaderNavigationButton
|
15
|
15
|
from '../../../../mobile/navigation/components/HeaderNavigationButton';
|
16
|
|
-import { navigateRoot } from '../../../../mobile/navigation/rootNavigationContainerRef';
|
17
|
|
-import { screen } from '../../../../mobile/navigation/routes';
|
18
|
16
|
import { getDialInfoPageURLForURIString } from '../../../functions';
|
19
|
17
|
|
20
|
18
|
import DialInSummaryErrorDialog from './DialInSummaryErrorDialog';
|
|
@@ -43,7 +41,7 @@ type Props = {
|
43
|
41
|
/**
|
44
|
42
|
* Implements a React native component that displays the dial in info page for a specific room.
|
45
|
43
|
*/
|
46
|
|
-class DialInSummary extends Component<Props> {
|
|
44
|
+class DialInSummary extends PureComponent<Props> {
|
47
|
45
|
|
48
|
46
|
/**
|
49
|
47
|
* Initializes a new instance.
|
|
@@ -53,7 +51,6 @@ class DialInSummary extends Component<Props> {
|
53
|
51
|
constructor(props: Props) {
|
54
|
52
|
super(props);
|
55
|
53
|
|
56
|
|
- this._onNavigateToRoot = this._onNavigateToRoot.bind(this);
|
57
|
54
|
this._onError = this._onError.bind(this);
|
58
|
55
|
this._onNavigate = this._onNavigate.bind(this);
|
59
|
56
|
this._renderLoading = this._renderLoading.bind(this);
|
|
@@ -68,6 +65,9 @@ class DialInSummary extends Component<Props> {
|
68
|
65
|
*/
|
69
|
66
|
componentDidMount() {
|
70
|
67
|
const { navigation, t } = this.props;
|
|
68
|
+ const onNavigationClose = () => {
|
|
69
|
+ navigation.goBack();
|
|
70
|
+ };
|
71
|
71
|
|
72
|
72
|
navigation.setOptions({
|
73
|
73
|
headerLeft: () => {
|
|
@@ -75,13 +75,15 @@ class DialInSummary extends Component<Props> {
|
75
|
75
|
return (
|
76
|
76
|
<HeaderNavigationButton
|
77
|
77
|
label = { t('dialog.close') }
|
78
|
|
- onPress = { this._onNavigateToRoot } />
|
|
78
|
+ // eslint-disable-next-line react/jsx-no-bind
|
|
79
|
+ onPress = { onNavigationClose } />
|
79
|
80
|
);
|
80
|
81
|
}
|
81
|
82
|
|
82
|
83
|
return (
|
83
|
84
|
<HeaderNavigationButton
|
84
|
|
- onPress = { this._onNavigateToRoot }
|
|
85
|
+ // eslint-disable-next-line react/jsx-no-bind
|
|
86
|
+ onPress = { onNavigationClose }
|
85
|
87
|
src = { IconClose } />
|
86
|
88
|
);
|
87
|
89
|
}
|
|
@@ -112,17 +114,6 @@ class DialInSummary extends Component<Props> {
|
112
|
114
|
);
|
113
|
115
|
}
|
114
|
116
|
|
115
|
|
- _onNavigateToRoot: () => void;
|
116
|
|
-
|
117
|
|
- /**
|
118
|
|
- * Callback to handle navigation back to root.
|
119
|
|
- *
|
120
|
|
- * @returns {void}
|
121
|
|
- */
|
122
|
|
- _onNavigateToRoot() {
|
123
|
|
- navigateRoot(screen.root);
|
124
|
|
- }
|
125
|
|
-
|
126
|
117
|
_onError: () => void;
|
127
|
118
|
|
128
|
119
|
/**
|