|
@@ -6,16 +6,22 @@ import BasicLoadingScreen from "./BasicLoadingScreen";
|
6
|
6
|
import ErrorView from "./ErrorView";
|
7
|
7
|
import {ERROR_TYPE} from "../../utils/WebData";
|
8
|
8
|
import MaterialHeaderButtons, {Item} from '../Overrides/CustomHeaderButton';
|
9
|
|
-import {HiddenItem} from "react-navigation-header-buttons";
|
|
9
|
+import {Divider, HiddenItem, OverflowMenu} from "react-navigation-header-buttons";
|
10
|
10
|
import i18n from 'i18n-js';
|
11
|
11
|
import {Animated, BackHandler, Linking} from "react-native";
|
12
|
12
|
import {withCollapsible} from "../../utils/withCollapsible";
|
|
13
|
+import MaterialCommunityIcons from "react-native-vector-icons/MaterialCommunityIcons";
|
|
14
|
+import {withTheme} from "react-native-paper";
|
|
15
|
+import type {CustomTheme} from "../../managers/ThemeManager";
|
|
16
|
+import {StackNavigationProp} from "@react-navigation/stack";
|
|
17
|
+import {Collapsible} from "react-navigation-collapsible";
|
13
|
18
|
|
14
|
19
|
type Props = {
|
15
|
|
- navigation: Object,
|
|
20
|
+ navigation: StackNavigationProp,
|
|
21
|
+ theme: CustomTheme,
|
16
|
22
|
url: string,
|
17
|
23
|
customJS: string,
|
18
|
|
- collapsibleStack: Object,
|
|
24
|
+ collapsibleStack: Collapsible,
|
19
|
25
|
onMessage: Function,
|
20
|
26
|
onScroll: Function,
|
21
|
27
|
showAdvancedControls: boolean,
|
|
@@ -104,19 +110,28 @@ class WebViewScreen extends React.PureComponent<Props> {
|
104
|
110
|
<Item
|
105
|
111
|
title="refresh"
|
106
|
112
|
iconName="refresh"
|
107
|
|
- onPress={this.onRefreshClicked}/>
|
108
|
|
- <HiddenItem
|
109
|
|
- title={i18n.t("general.goBack")}
|
110
|
|
- iconName="arrow-left"
|
111
|
|
- onPress={this.onGoBackClicked}/>
|
112
|
|
- <HiddenItem
|
113
|
|
- title={i18n.t("general.goForward")}
|
114
|
|
- iconName="arrow-right"
|
115
|
|
- onPress={this.onGoForwardClicked}/>
|
116
|
|
- <HiddenItem
|
117
|
|
- title={i18n.t("general.openInBrowser")}
|
118
|
|
- iconName="web"
|
119
|
|
- onPress={this.onOpenClicked}/>
|
|
113
|
+ onPress={this.onRefreshClicked}
|
|
114
|
+ />
|
|
115
|
+ <OverflowMenu
|
|
116
|
+ style={{marginHorizontal: 10}}
|
|
117
|
+ OverflowIcon={
|
|
118
|
+ <MaterialCommunityIcons
|
|
119
|
+ name="dots-vertical"
|
|
120
|
+ size={26}
|
|
121
|
+ color={this.props.theme.colors.text}
|
|
122
|
+ />}
|
|
123
|
+ >
|
|
124
|
+ <HiddenItem
|
|
125
|
+ title={i18n.t("general.goBack")}
|
|
126
|
+ onPress={this.onGoBackClicked}/>
|
|
127
|
+ <HiddenItem
|
|
128
|
+ title={i18n.t("general.goForward")}
|
|
129
|
+ onPress={this.onGoForwardClicked}/>
|
|
130
|
+ <Divider/>
|
|
131
|
+ <HiddenItem
|
|
132
|
+ title={i18n.t("general.openInBrowser")}
|
|
133
|
+ onPress={this.onOpenClicked}/>
|
|
134
|
+ </OverflowMenu>
|
120
|
135
|
</MaterialHeaderButtons>
|
121
|
136
|
);
|
122
|
137
|
}
|
|
@@ -179,4 +194,4 @@ class WebViewScreen extends React.PureComponent<Props> {
|
179
|
194
|
}
|
180
|
195
|
}
|
181
|
196
|
|
182
|
|
-export default withCollapsible(WebViewScreen);
|
|
197
|
+export default withCollapsible(withTheme(WebViewScreen));
|