Skip to content

Commit 02a45f0

Browse files
committed
Tapping unverified address notice opens address editing form
1 parent 29f92ea commit 02a45f0

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

WooCommerce/Classes/ViewRelated/Orders/Order Details/Shipping Labels/WooShipping Create Shipping Labels/WooShippingCreateLabelsView.swift

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,13 @@ struct WooShippingCreateLabelsView: View {
136136
}
137137
}
138138
}
139+
.sheet(item: $viewModel.addressToEdit) { addressToEdit in
140+
NavigationStack {
141+
WooShippingEditAddressView(viewModel: addressToEdit)
142+
.navigationTitle(Localization.BottomSheet.editDestination)
143+
.navigationBarTitleDisplayMode(.inline)
144+
}
145+
}
139146
}
140147
}
141148
}
@@ -229,13 +236,6 @@ private extension WooShippingCreateLabelsView {
229236
.buttonStyle(TextButtonStyle())
230237
}
231238
.padding(Layout.bottomSheetPadding)
232-
.sheet(item: $viewModel.addressToEdit) { addressToEdit in
233-
NavigationStack {
234-
WooShippingEditAddressView(viewModel: addressToEdit)
235-
.navigationTitle(Localization.BottomSheet.editDestination)
236-
.navigationBarTitleDisplayMode(.inline)
237-
}
238-
}
239239
}
240240

241241
/// View showing the order details, such as order items and shipping costs.
@@ -344,6 +344,11 @@ private extension WooShippingCreateLabelsView {
344344
.padding(.vertical, 12)
345345
.background(RoundedRectangle(cornerRadius: Layout.cornerRadius)
346346
.fill(Color(uiColor: isDestinationAddressVerified ? .withColorStudio(.green, shade: .shade0) : .withColorStudio(.red, shade: .shade0))))
347+
.onTapGesture {
348+
if !isDestinationAddressVerified {
349+
viewModel.editDestinationAddress()
350+
}
351+
}
347352
}
348353
}
349354
}

0 commit comments

Comments
 (0)