-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
42 lines (37 loc) · 1.28 KB
/
App.js
File metadata and controls
42 lines (37 loc) · 1.28 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
import { NavigationContainer } from "@react-navigation/native";
import { Routes } from "./src/pages/routes/routes";
import EStyleSheet from "react-native-extended-stylesheet";
import { Dimensions } from "react-native";
import { SafeAreaProvider } from "react-native-safe-area-context";
import { useState } from 'react'
import { GestureHandlerRootView } from 'react-native-gesture-handler';
// Pega largura da tela
const { width } = Dimensions.get("window");
// // Define o tamanho do REM de forma responsiva
EStyleSheet.build({
$rem: width > 700 ? 20 : width > 400 ? 18 : 16,
});
// Console do Screen-IFrame
if (typeof window !== "undefined" && window.parent) {
["log", "info", "warn", "error", "debug"].forEach((type) => {
const original = console[type].bind(console);
console[type] = function (...args) {
original(...args);
try {
window.parent.postMessage({ type: "console", level: type, args }, "*");
} catch (e) {}
};
});
}
export default function App() {
const [refreshKey, setRefreshKey] = useState(0);
return (
<GestureHandlerRootView>
<SafeAreaProvider>
<NavigationContainer style={{ flex: 1 }}>
<Routes key={refreshKey} triggerRefresh={() => setRefreshKey(k => k + 1)} />
</NavigationContainer>
</SafeAreaProvider>
</GestureHandlerRootView>
);
}