App.js 1.55 KB
Newer Older
Choi Ga Young's avatar
Choi Ga Young committed
1
2
3
4
5
6
7
import * as React from 'react';
import { StyleSheet, View, Text, TextInput, Button } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import Ionicons from 'react-native-vector-icons/Ionicons';
import Monthly from './Monthly';
import Analy from './Analy';
8
import PostMoney from './PostMoney';
Soo Hyun Kim's avatar
Soo Hyun Kim committed
9
import MainScreen from './MainScreen';
Test User's avatar
Test User committed
10

Choi Ga Young's avatar
Choi Ga Young committed
11
const Tab = createBottomTabNavigator();
Test User's avatar
Test User committed
12

Choi Ga Young's avatar
Choi Ga Young committed
13
function App() {
Test User's avatar
Test User committed
14
  return (
Choi Ga Young's avatar
Choi Ga Young committed
15
16
17
18
    <NavigationContainer>
      <Tab.Navigator screenOptions={({ route }) => ({
          tabBarIcon: ({ focused, color, size }) => {
            let iconName;
Test User's avatar
Test User committed
19

Choi Ga Young's avatar
Choi Ga Young committed
20
21
22
23
24
25
26
27
28
            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';
            }
Test User's avatar
Test User committed
29

Choi Ga Young's avatar
Choi Ga Young committed
30
31
32
33
34
35
36
37
38
39
            // You can return any component that you like here!
            return <Ionicons name={iconName} size={size} color={color} />;
          },
        })}
        tabBarOptions={{
          activeTintColor: 'tomato',
          inactiveTintColor: 'gray',
        }}>
        <Tab.Screen name="Main" component={MainScreen} />
        <Tab.Screen name="Monthly" component={Monthly} />
40
        <Tab.Screen name="Analy" component={PostMoney} />
Choi Ga Young's avatar
Choi Ga Young committed
41
42
      </Tab.Navigator>
    </NavigationContainer>
Test User's avatar
Test User committed
43
  );
Choi Ga Young's avatar
Choi Ga Young committed
44
}
Test User's avatar
Test User committed
45
46

export default App;