-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNavBar.swift
114 lines (94 loc) · 4.49 KB
/
NavBar.swift
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
import SwiftUI
struct NavBar: View {
@EnvironmentObject var viewRouter: ViewRouter
var body: some View {
ZStack(alignment: Alignment(horizontal: .center, vertical: .bottom), content: {
Rectangle()
.frame(width: UIScreen.main.bounds.width, height: 90)
.foregroundColor(.white)
HStack(spacing: 30){
Button(action: {
self.viewRouter.currentPage = "home"
}){
VStack{
Image("Home_black")
.resizable()
.frame(width: 34, height: 30)
.foregroundColor(.black)
Text("Home")
.font(
.custom("OpenSans-Regular", size: 10.0))
.foregroundColor(Color(#colorLiteral(red: 0.6117647059, green: 0.6117647059, blue: 0.6117647059, alpha: 1)))
}.frame(width: 50, height: 50)
}
Button(action: {
self.viewRouter.currentPage = "map"
}) {
VStack{
Image("Map_Black")
.resizable()
.frame(width: 20, height: 30)
.foregroundColor(.black)
Text("Map")
.font(
.custom("OpenSans-Regular", size: 10.0))
.foregroundColor(Color(#colorLiteral(red: 0.6117647059, green: 0.6117647059, blue: 0.6117647059, alpha: 1)))
}.frame(width: 50, height: 50)
}
Button(action:{
self.viewRouter.currentPage = "orders"
}){
ZStack{
ZStack(){
Circle()
.frame(width: 60, height: 60)
.foregroundColor(.white)
Circle()
.fill(Color(#colorLiteral(red: 0.3490196078, green: 0.3137254902, blue: 0.6509803922, alpha: 1)))
.frame(width: 55, height: 55)
.frame(width: 50, height: 50)
Image("Plus_white")
.resizable()
.colorMultiply(Color(.white))
.frame(width: 25, height: 25)
}.padding(.bottom, 105.0)
}
.frame(width:50, height:50)
}
Button(action: {
self.viewRouter.currentPage = "orders"
}){
VStack{
Image("Order_black")
.resizable()
.frame(width: 30, height: 28.42)
.foregroundColor(.black)
Text("Orders")
.font(
.custom("OpenSans-Regular", size: 10.0))
.foregroundColor(Color(#colorLiteral(red: 0.6117647059, green: 0.6117647059, blue: 0.6117647059, alpha: 1)))
}
}.frame(width: 50, height: 50)
Button(action: {
self.viewRouter.currentPage = "settings"
}){
VStack{
Image("Settings_black")
.resizable()
.frame(width: 26, height: 26)
.foregroundColor(.black)
Text("Settings")
.font(
.custom("OpenSans-Regular", size: 10.0))
.foregroundColor(Color(#colorLiteral(red: 0.6117647059, green: 0.6117647059, blue: 0.6117647059, alpha: 1)))
}.frame(width: 50, height: 50)
}
}.padding(.bottom, 13)
})
}
}
struct NavBar_Previews: PreviewProvider {
static var previews: some View {
NavBar().environmentObject(ViewRouter()).previewLayout(.sizeThatFits)
}
}