Skip to content

Commit 2bb36e4

Browse files
committed
Add cancel button for customs form printing view
1 parent b2de8cd commit 2bb36e4

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

WooCommerce/Classes/ViewModels/Order Details/OrderDetailsShipmentDetailsView.swift

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,16 @@ struct OrderDetailsShipmentDetailsView: View {
132132
}
133133
.sheet(isPresented: $shouldPrintCustomsForm) {
134134
if let url = shipment.shippingLabel?.commercialInvoiceURL {
135-
PrintCustomsFormsView(invoiceURLs: [url])
135+
NavigationStack {
136+
PrintCustomsFormsView(invoiceURLs: [url])
137+
.toolbar {
138+
ToolbarItem(placement: .cancellationAction) {
139+
Button(Localization.cancel) {
140+
shouldPrintCustomsForm = false
141+
}
142+
}
143+
}
144+
}
136145
}
137146
}
138147
}
@@ -219,5 +228,10 @@ private extension OrderDetailsShipmentDetailsView {
219228
value: "View purchased shipping label",
220229
comment: "Button to view details of a shipping label"
221230
)
231+
static let cancel = NSLocalizedString(
232+
"orderDetailsShipmentDetailsView.cancel",
233+
value: "Cancel",
234+
comment: "Button to dismiss printing customs form for a shipping label"
235+
)
222236
}
223237
}

0 commit comments

Comments
 (0)