-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnavigationBar.js
128 lines (127 loc) · 4.02 KB
/
navigationBar.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
import { StyleSheet, Text, View, TouchableOpacity } from "react-native";
import { theme } from "./colors";
import HomeIcon from "./assets/ios-home.svg";
import Info from "./assets/ios-information-circle-outline.svg";
import Cart from "./assets/ios-cart.svg";
import Chat from "./assets/ios-chatbubbles.svg";
import Profile from "./assets/md-person.svg";
import React from "react";
export default function NavigationBar({
home,
info,
shopping,
chatting,
myPage,
navigation,
}) {
return (
<View style={styles.naviationBar}>
<TouchableOpacity
style={styles.navigationItem}
onPress={() => navigation.navigate("Home", { navigation })}
>
<HomeIcon
width={20}
height={23}
fill={home ? theme.textDark : theme.iconGray}
style={{
marginTop: 14,
marginBottom: 9,
}}
/>
<Text
style={
home
? { color: theme.textDark }
: { color: theme.iconGray }
}
>
홈
</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.navigationItem}>
<Info
fill={info ? theme.textDark : theme.iconGray}
style={styles.navigationIcon}
/>
<Text
style={
info
? { color: theme.textDark }
: { color: theme.iconGray }
}
>
정보
</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.navigationItem}>
<Cart
fill={shopping ? theme.textDark : theme.iconGray}
style={styles.navigationIcon}
/>
<Text
style={
shopping
? { color: theme.textDark }
: { color: theme.iconGray }
}
>
쇼핑
</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.navigationItem}>
<Chat
fill={chatting ? theme.textDark : theme.iconGray}
style={styles.navigationIcon}
/>
<Text
style={
chatting
? { color: theme.textDark }
: { color: theme.iconGray }
}
>
채팅
</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.navigationItem}>
<Profile
fill={myPage ? theme.textDark : theme.iconGray}
style={{
marginTop: 15,
marginBottom: 8,
}}
/>
<Text
style={
myPage
? { color: theme.textDark }
: { color: theme.iconGray }
}
onPress={() =>
navigation.navigate("MyPage", { navigation })
}
>
마이페이지
</Text>
</TouchableOpacity>
</View>
);
}
const styles = StyleSheet.create({
naviationBar: {
flexDirection: "row",
justifyContent: "space-around",
borderTopColor: "#F5F5F5",
borderTopWidth: 1,
marginBottom: 20,
},
navigationItem: {
alignItems: "center",
width: 57,
},
navigationIcon: {
marginTop: 10,
marginBottom: 7,
},
});