-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
75 lines (69 loc) · 2.68 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
// App.js
import { Provider } from 'react-redux';
import store from './Redux/store';
import React from 'react';
import { createStackNavigator } from '@react-navigation/stack';
import { NavigationContainer } from '@react-navigation/native';
import { NameProvider } from './NameContext';
// Custom components
import HomeScreen from './components/pages/HomeScreen/HomeScreen';
import DetailsScreen from './components/pages/DetailsScreen/DetailsScreen';
import FoodInTake from './components/pages/FoodInTake/FoodInTake';
import Profile from './components/pages/Profile/Profile';
import ActivityMap from './components/pages/HashMap/HashMap';
import HistoricDataList from './components/pages/HistoricDataList.js/HistoricDataList';
import Basic from './components/pages/HistoricDataList.js/Basic';
import Notifications from './components/Notifications';
// Stack Navigator
const Stack = createStackNavigator();
const contributionData = [
[
{ date: '2023-01-01', eventOccurrence: 0 },
{ date: '2023-01-02', eventOccurrence: 3 },
{ date: '2023-01-03', eventOccurrence: 2 },
{ date: '2023-01-04', eventOccurrence: 1 },
{ date: '2023-01-05', eventOccurrence: 0 },
{ date: '2023-01-06', eventOccurrence: 0 },
{ date: '2023-01-07', eventOccurrence: 0 },
],
[
{ date: '2023-01-08', eventOccurrence: 0 },
{ date: '2023-01-09', eventOccurrence: 0 },
{ date: '2023-01-10', eventOccurrence: 0 },
{ date: '2023-01-11', eventOccurrence: 2 },
{ date: '2023-01-12', eventOccurrence: 10 },
{ date: '2023-01-13', eventOccurrence: 0 },
{ date: '2023-01-14', eventOccurrence: 0 },
],
];
const contributionDataWithDateId = contributionData.map((week) => {
return week.map((day) => {
return {
...day,
dateid: Date.parse(day.date)
}
});
});
const App = () => (
<Provider store={store}>
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen name="Home" component={HomeScreen} />
<Stack.Screen name="Details" component={DetailsScreen} />
<Stack.Screen name="FoodInTake" component={FoodInTake} />
<Stack.Screen name="Profile" component={Profile} />
<Stack.Screen
name="HashMap"
component={ActivityMap}
initialParams={{
data: contributionDataWithDateId
}}
/>
<Stack.Screen name="History" component={HistoricDataList} />
<Stack.Screen name="Basic" component={Basic} />
<Stack.Screen name="Notifications" component={Notifications} />
</Stack.Navigator>
</NavigationContainer>
</Provider>
);
export default App;