-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathApp.tsx
More file actions
34 lines (29 loc) · 843 Bytes
/
App.tsx
File metadata and controls
34 lines (29 loc) · 843 Bytes
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
import 'regenerator-runtime/runtime';
import React from "react";
import { StatusBar } from "expo-status-bar";
import { SafeAreaProvider } from "react-native-safe-area-context";
import { SafeAreaView, useSafeAreaInsets } from "react-native-safe-area-context";
import GameEngine from "./game/systems/GameEngine";
export default function App() {
return (
<>
<StatusBar backgroundColor="orange" hidden={true} />
<SafeAreaProvider>
<SafeView />
</SafeAreaProvider>
</>
);
}
function SafeView() {
const { top, bottom, left, right } = useSafeAreaInsets();
const topInset = top.valueOf();
global.topInset = topInset;
global.bottomInset = bottom;
global.leftInset = left;
global.rightInset = right;
return (
<SafeAreaView style={{ flex: 1 }}>
<GameEngine />
</SafeAreaView>
);
}