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

YoonDongMin's avatar
YDm    
YoonDongMin committed
18

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

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

Choi Ga Young's avatar
Choi Ga Young committed
28
29
30
31
32
33
34
35
        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';
36
        }
Choi Ga Young's avatar
Choi Ga Young committed
37
38
39
40
41
42
43
44
45
46
47
48
49
50
        return <Ionicons name={iconName} size={size} color={color} />;
      },
    })}
      tabBarOptions={{
        activeTintColor: 'skyblue',
        inactiveTintColor: 'gray',
      }}>
      <Tab.Screen name="Main" component={MainScreen} />
      <Tab.Screen name="Monthly" component={Monthly} />
      <Tab.Screen name="Analy" component={Analy} />
      <Tab.Screen name="PostMoney" component={PostMoney} />
    </Tab.Navigator>
  )
}
Test User's avatar
Test User committed
51

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

Choi Ga Young's avatar
Choi Ga Young committed
98
const style = StyleSheet.create({
YoonDongMin's avatar
YdM    
YoonDongMin committed
99

Choi Ga Young's avatar
Choi Ga Young committed
100
101
102
103
104
  TextInput: {
    borderColor: 'skyblue',
    height: 40,
    margin: 12,
    borderWidth: 1
Test User's avatar
Test User committed
105
  },
Choi Ga Young's avatar
Choi Ga Young committed
106
107
  Font: {
    fontSize: 24
Choi Ga Young's avatar
Choi Ga Young committed
108
109
110
111
  },
  Contents: {
    justifyContent: "center",
    alignItems: "center",
Choi Ga Young's avatar
Choi Ga Young committed
112
    margin: 10
Choi Ga Young's avatar
Choi Ga Young committed
113
  }
Test User's avatar
Test User committed
114
115
});
export default App;