-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
81 lines (72 loc) · 2.44 KB
/
Copy pathApp.js
File metadata and controls
81 lines (72 loc) · 2.44 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
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
81
// import { StatusBar } from 'expo-status-bar';
// import React, { useState, useEffect } from 'react';
// import { StyleSheet, Text, View } from 'react-native';
// import { db } from './firebase';
// //this allows us to get information from the firestore database
// export default function App() {
// const [examples, setExamples] = useState([]);
// useEffect(() => {
// const ref = db.collection('examples');
// ref.onSnapshot((query) => {
// const objs = [];
// query.forEach((doc) => {
// objs.push({
// id: doc.id,
// ...doc.data(),
// });
// });
// setExamples(objs);
// });
// }, [])
// return (
// <View style={styles.container}>
// {examples.map((obj) => (
// <View id={obj.id}>
// <Text>{obj.name}</Text>
// </View>
// ))}
// <StatusBar style="auto" />
// </View>
// );
// }
// const styles = StyleSheet.create({
// container: {
// flex: 1, alignItems: 'center', justifyContent: 'center'
// },
// });
// //end of receiving information from the dummy firestore
// everything below includes camera + home screen and navigation
import "react-native-gesture-handler";
import * as React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import * as firebase from "firebase";
import "firebase/firestore";
import apiKeys from './config/keys';
//screens
import CameraScreen from "./camera";
import IngredientScreen from "./IngredientScreen";
import LoginScreen from "./screens/LoginScreen";
import ProfileScreen from "./screens/ProfileScreen";
import HomeScreen from "./screens/HomeScreen";
const Stack = createNativeStackNavigator();
export default function App() {
if (!firebase.apps.length) {
console.log('Connected with Firebase')
firebase.initializeApp(apiKeys.firebaseConfig);
}
return (
<NavigationContainer>
<Stack.Navigator initialRouteName="Login">
<Stack.Screen name="Login" component={LoginScreen} />
<Stack.Screen name='Profile'component={ProfileScreen} />
<Stack.Screen name="Home" component={HomeScreen} />
<Stack.Screen name="Camera" component={CameraScreen} />
<Stack.Screen name="IngredientScreen" component={IngredientScreen} />
</Stack.Navigator>
</NavigationContainer>
);
}
// let preferences = {
// numberOfRecipe : 1
// }