-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
90 lines (64 loc) · 2.11 KB
/
App.js
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import { StatusBar as ExpoStatusBar } from "expo-status-bar";
import React, { useState, useEffect } from "react";
import { Text } from "react-native";
import { ThemeProvider } from "styled-components/native";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
import { initializeApp } from "firebase/app";
import { getAuth, signInWithEmailAndPassword } from "firebase/auth";
import {
useFonts as useOswald,
Oswald_400Regular,
} from '@expo-google-fonts/oswald';
import {
useFonts as useLato,
Lato_400Regular,
} from '@expo-google-fonts/lato';
import { theme } from "./src/infrastructure/theme"
import { SafeArea } from "./src/components/utility/safe-area.component";
import { Navigation } from "./src/infrastructure/navigation";
import { AuthenticationContextProvider } from "./src/services/authentication/authentication.context";
const firebaseConfig = {
apiKey: "AIzaSyDPTh7_wGywiyM_3b5hHY32KvATe5VpfNE",
authDomain: "mealstogo-8ab13.firebaseapp.com",
projectId: "mealstogo-8ab13",
storageBucket: "mealstogo-8ab13.appspot.com",
messagingSenderId: "617232651916",
appId: "1:617232651916:web:c3a91bdf935e9b50994da9"
};
const app = initializeApp(firebaseConfig);
export const auth = getAuth(app);
const Tab = createBottomTabNavigator();
export default function App() {
const [isAuthenticated, setIsAuthenticated] = useState(false);
useEffect(() => {
setTimeout(() => {
signInWithEmailAndPassword(auth, "[email protected]", "password")
.then((user) => {
console.log(user);
setIsAuthenticated(true);
}).catch((e) => {
console.log(e);
})
}, 2000)
}, []);
const [oswaldLoaded] = useOswald({
Oswald_400Regular,
});
const [latoLoaded] = useLato({
Lato_400Regular,
});
if (!oswaldLoaded || !latoLoaded) {
return null;
}
return (
<>
<ThemeProvider theme={theme}>
<AuthenticationContextProvider>
< Navigation />
</AuthenticationContextProvider>
</ThemeProvider>
<ExpoStatusBar style="auto" />
</>
);
}
// adb shell input keyevent 82 -> dev menu