Skip to content

Commit 9b3d2ea

Browse files
committed
Set bottom sheet titles when creating a product
1 parent 654bbee commit 9b3d2ea

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

WooCommerce/Classes/ViewRelated/Products/Add Product/AddProductCoordinator.swift

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,11 @@ private extension AddProductCoordinator {
8686
/// Presents a bottom sheet for users to choose if they want a create a product manually or via a template.
8787
///
8888
func presentProductCreationTypeBottomSheet() {
89-
let title = NSLocalizedString("How do you want to start?",
89+
let title = NSLocalizedString("Add a product",
9090
comment: "Message title of bottom sheet for selecting a template or manual product")
91-
let viewProperties = BottomSheetListSelectorViewProperties(subtitle: title)
91+
let subtitle = NSLocalizedString("How do you want to start?",
92+
comment: "Message subtitle of bottom sheet for selecting a template or manual product")
93+
let viewProperties = BottomSheetListSelectorViewProperties(title: title, subtitle: subtitle)
9294
let command = ProductCreationTypeSelectorCommand { selectedCreationType in
9395
self.trackProductCreationType(selectedCreationType)
9496
self.presentProductTypeBottomSheet(creationType: selectedCreationType)
@@ -100,9 +102,13 @@ private extension AddProductCoordinator {
100102
/// Presents a bottom sheet for users to choose if what kind of product they want to create.
101103
///
102104
func presentProductTypeBottomSheet(creationType: ProductCreationType) {
103-
let title = NSLocalizedString("Select a product type",
104-
comment: "Message title of bottom sheet for selecting a product type to create a product")
105-
let viewProperties = BottomSheetListSelectorViewProperties(subtitle: title)
105+
let title: String? = {
106+
guard creationType == .template else { return nil }
107+
return NSLocalizedString("Choose a template", comment: "Message title of bottom sheet for selecting a template or manual product")
108+
}()
109+
let subtitle = NSLocalizedString("Select a product type",
110+
comment: "Message subtitle of bottom sheet for selecting a product type to create a product")
111+
let viewProperties = BottomSheetListSelectorViewProperties(title: title, subtitle: subtitle)
106112
let command = ProductTypeBottomSheetListSelectorCommand(selected: nil) { selectedBottomSheetProductType in
107113
ServiceLocator.analytics.track(.addProductTypeSelected, withProperties: ["product_type": selectedBottomSheetProductType.productType.rawValue])
108114
self.navigationController.dismiss(animated: true) {

0 commit comments

Comments
 (0)