Skip to content

Commit 84d2e6a

Browse files
committed
Use NavigationStack in previews
1 parent 33a996d commit 84d2e6a

File tree

1 file changed

+2
-34
lines changed

1 file changed

+2
-34
lines changed

WooCommerce/Classes/ViewRelated/Orders/Payment Methods/PaymentMethodsView.swift

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,9 @@ extension PaymentMethodsView {
250250
}
251251
}
252252

253-
// MARK: Previews
254-
#Preview("Light") {
253+
#Preview {
255254
@Previewable @State var rootViewController = UIViewController()
256-
NavigationView {
255+
NavigationStack {
257256
PaymentMethodsView(
258257
rootViewController: rootViewController,
259258
viewModel: PaymentMethodsViewModel(total: "15.99",
@@ -263,35 +262,4 @@ extension PaymentMethodsView {
263262
)
264263
.navigationBarTitleDisplayMode(.inline)
265264
}
266-
.environment(\.colorScheme, .light)
267-
}
268-
269-
#Preview("Dark") {
270-
@Previewable @State var rootViewController = UIViewController()
271-
NavigationView {
272-
PaymentMethodsView(
273-
rootViewController: rootViewController,
274-
viewModel: PaymentMethodsViewModel(total: "15.99",
275-
formattedTotal: "$15.99",
276-
flow: .orderPayment,
277-
channel: .storeManagement)
278-
)
279-
.navigationBarTitleDisplayMode(.inline)
280-
}
281-
.environment(\.colorScheme, .dark)
282-
}
283-
284-
#Preview("Accessibility") {
285-
@Previewable @State var rootViewController = UIViewController()
286-
NavigationView {
287-
PaymentMethodsView(
288-
rootViewController: rootViewController,
289-
viewModel: PaymentMethodsViewModel(total: "15.99",
290-
formattedTotal: "$15.99",
291-
flow: .orderPayment,
292-
channel: .storeManagement)
293-
)
294-
.navigationBarTitleDisplayMode(.inline)
295-
}
296-
.environment(\.sizeCategory, .accessibilityExtraExtraLarge)
297265
}

0 commit comments

Comments
 (0)