Skip to content

Commit

Permalink
Update cash view to dismiss via environment
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgabrielma committed Dec 23, 2024
1 parent e656b3b commit 8d723fa
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import SwiftUI

struct PointOfSaleCollectCashView: View {
@Environment(\.dismiss) private var dismiss
@EnvironmentObject private var posModel: PointOfSaleAggregateModel

@State private var textFieldAmountInput: String = ""
@State private var isLoading: Bool = false
@State private var errorMessage: String?

@Binding var isVisible: Bool
let orderTotal: String

private var formattedOrderTotal: String {
Expand All @@ -18,7 +18,7 @@ struct PointOfSaleCollectCashView: View {
VStack(alignment: .center, spacing: 20) {
HStack {
Button(action: {
isVisible = false
dismiss()
}, label: {
VStack {
HStack {
Expand Down Expand Up @@ -131,7 +131,6 @@ private extension PointOfSaleCollectCashView {
itemsController: PointOfSalePreviewItemsController(),
cardPresentPaymentService: CardPresentPaymentPreviewService(),
orderController: PointOfSalePreviewOrderController())
PointOfSaleCollectCashView(isVisible: .constant(true),
orderTotal: "$1.23")
PointOfSaleCollectCashView(orderTotal: "$1.23")
.environmentObject(posModel)
}

0 comments on commit 8d723fa

Please sign in to comment.