-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
49 lines (48 loc) · 1.47 KB
/
App.js
File metadata and controls
49 lines (48 loc) · 1.47 KB
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
import React, {useEffect} from 'react';
import {WebView} from 'react-native-webview';
import {SafeAreaView, StatusBar, View, Platform} from 'react-native';
import SplashScreen from 'react-native-splash-screen';
import LinearGradient from 'react-native-linear-gradient';
import {getStatusBarHeight} from 'react-native-status-bar-height';
const App = () => {
const STATUSBAR_HEIGHT = StatusBar.currentHeight;
const statusBarHeight = getStatusBarHeight(true);
useEffect(() => {
try {
setTimeout(() => {
console.log(statusBarHeight);
SplashScreen.hide();
}, 500);
} catch (e) {
console.warn(e);
}
});
return (
<View style={{flex: 1}}>
{Platform.OS === 'ios' ? (
<LinearGradient
useAngle={true}
angle={90}
colors={['#818cf8', '#d8b4fe', '#f9a8d4']}
style={{height: 44}}>
<StatusBar backgroundColor={'transparent'} translucent />
</LinearGradient>
) : (
<LinearGradient
useAngle={true}
angle={90}
colors={['#818cf8', '#d8b4fe', '#f9a8d4']}
style={{height: STATUSBAR_HEIGHT}}>
<StatusBar backgroundColor={'transparent'} translucent />
</LinearGradient>
)}
<WebView
scrollEnabled={false}
source={{uri: 'http://13.125.103.60/'}}
// source={{uri: 'http://localhost:5173/'}}
style={{height: '100%', width: '100%'}}
/>
</View>
);
};
export default App;