-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
49 lines (39 loc) · 1.57 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
import 'react-native-get-random-values';
import React, { useState, useEffect } from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import registerNNPushToken from 'native-notify';
import Home from './src/screens/Home';
import ChosenTask from './src/screens/ChosenTask';
import Liquidity from "./src/screens/Liquidity";
const Stack = createNativeStackNavigator();
export default function App() {
// push notifications
//registerNNPushToken(your-app-id, 'your-app-token');
// get App ID and App Token from NativeNotify.com
// globalstate management
const [toDoList, setToDoList] = useState([{ id: 1, task: 'brush your teeth' }]);
const [task, setTask] = useState('');
const [chosenTask, setChosenTask] = useState('');
const GlobalState = {
toDoList, setToDoList,
task, setTask,
chosenTask, setChosenTask
}
// navigation
return (
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen name="Home" options={{ headerShown: false }}>
{props => <Home {...props} GlobalState={GlobalState} />}
</Stack.Screen>
<Stack.Screen name="ChosenTask" options={{ headerShown: false }}>
{props => <ChosenTask {...props} GlobalState={GlobalState} />}
</Stack.Screen>
<Stack.Screen name="Liquidity" options={{ headerShown: false }}>
{props => <Liquidity {...props} GlobalState={GlobalState} />}
</Stack.Screen>
</Stack.Navigator>
</NavigationContainer>
);
}