Skip to content

Commit 39adac5

Browse files
committed
Replace default back button with minimal back button
1 parent 350a096 commit 39adac5

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

WooCommerce/Classes/ViewRelated/Orders/Order Creation/ProductsSection/AddProductVariationToOrder.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import SwiftUI
33
/// View showing a list of product variations to add to an order.
44
///
55
struct AddProductVariationToOrder: View {
6+
@Environment(\.presentationMode) private var presentation
7+
68
/// Defines whether the view is presented.
79
///
810
@Binding var isPresented: Bool
@@ -43,6 +45,17 @@ struct AddProductVariationToOrder: View {
4345
.ignoresSafeArea(.container, edges: .horizontal)
4446
.navigationTitle(viewModel.productName)
4547
.navigationBarTitleDisplayMode(.inline)
48+
.navigationBarBackButtonHidden(true)
49+
.toolbar {
50+
// Minimal back button
51+
ToolbarItem(placement: .navigationBarLeading) {
52+
Button {
53+
presentation.wrappedValue.dismiss()
54+
} label: {
55+
Image(uiImage: .chevronLeftImage.imageFlippedForRightToLeftLayoutDirection())
56+
}
57+
}
58+
}
4659
.onAppear {
4760
viewModel.syncFirstPage()
4861
}

0 commit comments

Comments
 (0)