App.js 3.05 KB
Newer Older
1
import React from 'react';
Choi Ga Young's avatar
Choi Ga Young committed
2
3
import { NavigationContainer } from '@react-navigation/native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
Choi Ga Young's avatar
Choi Ga Young committed
4
import { createStackNavigator } from '@react-navigation/stack';
Choi Ga Young's avatar
Choi Ga Young committed
5
6
import Ionicons from 'react-native-vector-icons/Ionicons';
import Monthly from './Monthly';
Choi Ga Young's avatar
Choi Ga Young committed
7
import Analy from './Analy';
8
import PostMoney from './PostMoney';
Soo Hyun Kim's avatar
Soo Hyun Kim committed
9
import MainScreen from './MainScreen';
Choi Ga Young's avatar
Choi Ga Young committed
10
import CalDetail from './CalDetail';
YoonDongMin's avatar
부채    
YoonDongMin committed
11
import DeptPage from './DeptPage';
YoonDongMin's avatar
YDm    
YoonDongMin committed
12
import DeptDetails from './screens/DeptDetails';
YoonDongMin's avatar
YdM    
YoonDongMin committed
13
14
import MemoPage from './MemoPage';
import MemoDetails from './screens/MemoDetails';
15
import EditOption from './EditOption';
Test User's avatar
Test User committed
16

Choi Ga Young's avatar
Choi Ga Young committed
17
const Tab = createBottomTabNavigator();
Choi Ga Young's avatar
Choi Ga Young committed
18
const Stack = createStackNavigator();
Test User's avatar
Test User committed
19

Choi Ga Young's avatar
Choi Ga Young committed
20
function Home() {
Test User's avatar
Test User committed
21
  return (
Choi Ga Young's avatar
Choi Ga Young committed
22
23
24
    <Tab.Navigator screenOptions={({ route }) => ({
      tabBarIcon: ({ focused, color, size }) => {
        let iconName;
Test User's avatar
Test User committed
25

Choi Ga Young's avatar
Choi Ga Young committed
26
27
28
29
30
31
32
33
        if (route.name === 'Main') {
          iconName = focused
            ? 'home'
            : 'home-outline';
        } else if (route.name === 'Monthly') {
          iconName = focused ? 'calendar' : 'calendar-outline';
        } else if (route.name === 'Analy') {
          iconName = focused ? 'bar-chart' : 'bar-chart-outline';
34
        }
Choi Ga Young's avatar
Choi Ga Young committed
35
36
37
38
        return <Ionicons name={iconName} size={size} color={color} />;
      },
    })}
      tabBarOptions={{
39
        activeTintColor: '#bfd3f2',
Choi Ga Young's avatar
Choi Ga Young committed
40
41
42
43
44
45
46
47
        inactiveTintColor: 'gray',
      }}>
      <Tab.Screen name="Main" component={MainScreen} />
      <Tab.Screen name="Monthly" component={Monthly} />
      <Tab.Screen name="Analy" component={Analy} />
    </Tab.Navigator>
  )
}
Test User's avatar
Test User committed
48

Choi Ga Young's avatar
Choi Ga Young committed
49
50
51
function App() {
  return (
    <NavigationContainer>
YoonDongMin's avatar
YdM    
YoonDongMin committed
52
53
54
55
56
      <Stack.Navigator screenOptions={{
        headerStyle: {
          backgroundColor: '#eee'
        },
        headerTitleStyle: {
YoonDongMin's avatar
YDm    
YoonDongMin committed
57
          fontFamily: 'GowunDodum-Regular'
YoonDongMin's avatar
YdM    
YoonDongMin committed
58
59
60
61
62
63
64
65
66
67
        },
        headerTitleAlign: 'center'
      }} >
        <Stack.Screen
          name="Home"
          component={Home}
          options={{ headerShown: false }} />
        <Stack.Screen
          name="DeptPage"
          component={DeptPage}
YoonDongMin's avatar
YDm    
YoonDongMin committed
68
          options={{ title: "부채", headerStyle: { backgroundColor: '#bfd3f2' } }} />
YoonDongMin's avatar
YdM    
YoonDongMin committed
69
        <Stack.Screen
YoonDongMin's avatar
YDm    
YoonDongMin committed
70
71
          name="DeptDetails"
          component={DeptDetails}
YoonDongMin's avatar
YdM    
YoonDongMin committed
72
73
74
75
          options={{ title: "상세정보" }} />
        <Stack.Screen
          name="MemoPage"
          component={MemoPage}
YoonDongMin's avatar
YDm    
YoonDongMin committed
76
          options={{ title: "메모", headerStyle: { backgroundColor: '#bfd3f2' } }} />
YoonDongMin's avatar
YdM    
YoonDongMin committed
77
78
79
80
        <Stack.Screen
          name="MemoDetails"
          component={MemoDetails}
          options={{ title: "상세내용" }} />
Choi Ga Young's avatar
Choi Ga Young committed
81
        <Stack.Screen
Choi Ga Young's avatar
Choi Ga Young committed
82
83
          name="CalDetail"
          component={CalDetail}
Choi Ga Young's avatar
Choi Ga Young committed
84
          options={{ title: "일일내역" }} />
85
86
87
88
89
        <Stack.Screen
          name="EditOption"
          component={EditOption}
          options={{ title: "편집" }}
        />
Soo Hyun Kim's avatar
Soo Hyun Kim committed
90
91
92
93
94
        <Stack.Screen
          name="PostMoney"
          component={PostMoney}
          options={{ title: "추가" }}
        />
Choi Ga Young's avatar
Choi Ga Young committed
95
      </Stack.Navigator>
Choi Ga Young's avatar
Choi Ga Young committed
96
    </NavigationContainer>
Test User's avatar
Test User committed
97
  );
Choi Ga Young's avatar
Choi Ga Young committed
98
}
Test User's avatar
Test User committed
99
100

export default App;