Skip to content

Commit

Permalink
Simplify TipJar appearance
Browse files Browse the repository at this point in the history
  • Loading branch information
hartlco committed Feb 9, 2020
1 parent 5499a8a commit 0d13f59
Showing 1 changed file with 15 additions and 26 deletions.
41 changes: 15 additions & 26 deletions Icro/View/TipJarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,24 @@ import IcroKit

struct TipJarView: View {
@ObservedObject var viewModel: TipJarViewModel
private let cardColor = SwiftUI.Color("accentSuperLight")

var body: some View {
HStack {
ScrollView {
VStack(spacing: 20) {
ForEach(viewModel.products) { product in
Button(action: {
self.viewModel.purchase(product: product)
}, label: {
HStack {
Text(product.title)
.font(.headline)
.foregroundColor(.primary)
Spacer(minLength: 10)
Group {
Text(product.price)
.foregroundColor(.red)
}
.padding(.all, 8)
}
})
.padding()
.background(self.cardColor)
.cornerRadius(6)
}
List(viewModel.products) { product in
Button(action: {
self.viewModel.purchase(product: product)
}, label: {
HStack {
Text(product.title)
.font(.headline)
.foregroundColor(.primary)
Spacer(minLength: 10)
Group {
Text(product.price)
.foregroundColor(.red)
}
.padding(.all, 8)
}
}
.frame(minHeight: 110)
})
}
}
}
Expand Down

0 comments on commit 0d13f59

Please sign in to comment.