-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
60 lines (53 loc) · 1.67 KB
/
App.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import * as React from "react";
import { NavigationContainer } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import * as ScreenOrientation from "expo-screen-orientation";
import HomeScreen from "./screens/HomeScreen";
import VideoTestScreen from "./screens/VideoTestScreen";
import WebViewScreen from "./screens/WebViewScreen";
import ReactNativeVideoScreen from "./screens/ReactNativeVideoScreen";
const Stack = createNativeStackNavigator();
export type RootStackParamList = {
Home: undefined;
WebView: undefined;
VideoTest: undefined;
};
function App() {
React.useEffect(() => {
ScreenOrientation.lockAsync(ScreenOrientation.OrientationLock.PORTRAIT_UP);
}, []);
return (
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen
name="Home"
options={{ title: "Hypersay WebView Tester" }}
component={HomeScreen}
/>
<Stack.Screen
name="VideoTest"
options={{ title: "Video Test Pages" }}
component={VideoTestScreen}
/>
<Stack.Screen
name="WebView"
component={WebViewScreen}
options={({ route }) => ({
title:
(route?.params as Record<string, string>).title || "Web View",
})}
/>
<Stack.Screen
name="ReactNativeVideo"
component={ReactNativeVideoScreen}
options={({ route }) => ({
title:
(route?.params as Record<string, string>).title ||
"React Native Video",
})}
/>
</Stack.Navigator>
</NavigationContainer>
);
}
export default App;