-
Notifications
You must be signed in to change notification settings - Fork 0
/
SummaryView.swift
102 lines (50 loc) · 3.37 KB
/
SummaryView.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
import SwiftUI
struct SummaryView: View {
@EnvironmentObject var viewRouter: ViewRouter
var body: some View {
ScrollView(.vertical, showsIndicators: false){
VStack {
ForEach(cart.items, id: \.name) { item in
HStack {
Spacer()
ZStack{
RoundedRectangle(cornerRadius: 20)
.fill(Color(#colorLiteral(red: 1, green: 0.8237730801, blue: 0.6205014913, alpha: 0.1529520255)))
.frame(width: 60, height: 60)
item.image.resizable()
.aspectRatio(contentMode: .fit)
.frame(height: 40)
}
VStack(alignment:.leading) {
Text(item.name)
.font(.custom("OpenSans-Semibold", size: 16))
}.frame(width:200, alignment: .leading)
Text(String(format: "$%.2f", item.price))
.font(.custom("OpenSans-Semibold", size: 16))
.foregroundColor(Color(#colorLiteral(red: 0.6117647059, green: 0.6117647059, blue: 0.6117647059, alpha: 1)))
Spacer()
Button(action: {
viewRouter.currentPage = "orders"
}){
ZStack{
RoundedRectangle(cornerRadius: 9)
.strokeBorder(Color(#colorLiteral(red: 0.9490196078, green: 0.4705882353, blue: 0.3607843137, alpha: 1)), lineWidth: 1)
.frame(width: 26, height: 26)
Image("edit").resizable()
.aspectRatio(contentMode: .fit)
.frame(height: 11)
.colorMultiply(Color(#colorLiteral(red: 0.9490196078, green: 0.4705882353, blue: 0.3607843137, alpha: 1)))
}
}.padding(.top, -3)
Spacer()
}
}
}
}.frame(maxHeight: 350)
}
}
struct SummaryView_Previews: PreviewProvider {
static var previews: some View {
SummaryView()
}
}