-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNav.js
76 lines (65 loc) · 2.41 KB
/
Nav.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
76
// 필요없는 페이지
import { StatusBar } from 'expo-status-bar';
import { StyleSheet, Text, View, Image,TouchableOpacity } from 'react-native';
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
import {NavigationContainer} from '@react-navigation/native';
import {createNativeStackNavigator} from '@react-navigation/native-stack';
import Home from './components/Home';
import Write from './components/Write';
import Receive from './components/Receive';
import Auth from './Auth';
import Login from './Login';
const Tab = createBottomTabNavigator();
export default function App() {
return (
<View style={styles.background}>
<Image source={require('gomaoom/assets/blueTop.png')}/>
<StatusBar style="auto" />
<NavigationContainer style={styles.nav}>
<Tab.Navigator
screenOptions={({route}) => ({
tabBarIcon: ({focused, color, size}) => {
let iconName;
if (route.name === '홈') {
iconName = focused
? require('./assets/icons/Home.png')
: require('./assets/icons/Home.png');
} else if (route.name === '보관함') {
iconName = focused
? require('./assets/icons/mailbox.png')
: require('./assets/icons/mailbox.png');
} else if (route.name === '작성하기') {
iconName = focused
? require('./assets/icons/Write.png')
: require('./assets/icons/Write.png');
}
return (
<Image source={iconName} style={{width: 25, height: 25}} />
);
},
})}>
<Tab.Screen name="보관함" component={Receive}/>
<Tab.Screen name="홈" component={Home}/>
<Tab.Screen name="작성하기" component={Write}/>
<Tab.Screen name="회원가입" component={Auth}/>
<Tab.Screen name="로그인" component={Login}/>
</Tab.Navigator>
</NavigationContainer>
</View>
);
}
const styles = StyleSheet.create({
background:{
backgroundColor: '#FFFCF8',
flex:1,
},
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
nav:{
backgroundColor:'#CCE0CC',
padding:40,
},
});