-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
62 lines (53 loc) · 1.99 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
import React, { useEffect } from 'react'
import { View, StatusBar } from 'react-native'
import { NavigationContainer } from '@react-navigation/native'
import { createStackNavigator } from '@react-navigation/stack'
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'
import { FontAwesome, Ionicons } from '@expo/vector-icons'
import DeckList from './components/DeckList'
import Deck from './components/Deck'
import NewQuestion from './components/NewQuestion'
import Quiz from './components/Quiz'
import NewDeck from './components/NewDeck'
import { setLocalNotification } from './utils/helper'
const Stack = createStackNavigator()
const Tab = createBottomTabNavigator()
function StackScreens() {
return (
<Stack.Navigator initialRouteName="decklist">
<Stack.Screen name="decklist" component={DeckList} options={{ title: 'All Decks' }} />
<Stack.Screen name="deck" component={Deck} />
<Stack.Screen name="newquestion" component={NewQuestion} options={{ title: 'Add New Card' }} />
<Stack.Screen name="quiz" component={Quiz} options={{ title: 'Take Quiz' }} />
</Stack.Navigator>
)
}
export default function App() {
useEffect(() => {
console.log("notify")
setLocalNotification()
}, [])
return (
<NavigationContainer>
<View style={{ flex: 1 }}>
<StatusBar translucent backgroundColor={'white'} barStyle="dark-content" />
<Tab.Navigator initialRouteName="Home">
<Tab.Screen name="home" component={StackScreens}
options={{
title: 'Home',
tabBarIcon: () =>
<Ionicons name='ios-bookmarks' size={30} color={"skyblue"} />
}}
/>
<Tab.Screen name="newdeck" component={NewDeck}
options={{
title: 'New Deck',
tabBarIcon: () =>
<FontAwesome name='plus-square' size={30} color={"skyblue"} />
}}
/>
</Tab.Navigator>
</View>
</NavigationContainer>
)
}