-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10251 from woocommerce/issue/10190-iap-full-featu…
…re-list-screen [IAP] M2 Full Feature List screen
- Loading branch information
Showing
5 changed files
with
394 additions
and
1 deletion.
There are no files selected for viewing
92 changes: 92 additions & 0 deletions
92
WooCommerce/Classes/ViewRelated/Upgrades/FullFeatureListView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import Foundation | ||
import SwiftUI | ||
|
||
struct FullFeatureListView: View { | ||
@Environment(\.presentationMode) var presentationMode | ||
|
||
var featureListGroups = FullFeatureListViewModel.hardcodedFullFeatureList() | ||
|
||
var body: some View { | ||
ScrollView() { | ||
VStack(alignment: .leading, spacing: FullFeatureListView.Layout.featureListSpacing) { | ||
ForEach(featureListGroups, id: \.title) { featureList in | ||
Text(featureList.title) | ||
.font(.title) | ||
.bold() | ||
.padding(.top) | ||
.padding(.bottom) | ||
ForEach(featureList.essentialFeatures, id: \.self) { feature in | ||
Text(feature) | ||
.font(.body) | ||
} | ||
ForEach(featureList.performanceFeatures, id: \.self) { feature in | ||
HStack { | ||
Text(feature) | ||
.font(.body) | ||
Image(systemName: "star.fill") | ||
.foregroundColor(.withColorStudio(name: .wooCommercePurple, shade: .shade50)) | ||
.font(.footnote) | ||
} | ||
} | ||
Divider() | ||
.padding(.top) | ||
.padding(.bottom) | ||
HStack { | ||
Image(systemName: "star.fill") | ||
Text(Localization.performanceOnlyText) | ||
} | ||
.font(.footnote) | ||
.foregroundColor(.withColorStudio(name: .wooCommercePurple, shade: .shade50)) | ||
.padding(.bottom) | ||
.renderedIf(featureList.performanceFeatures.isNotEmpty) | ||
} | ||
} | ||
.padding(.horizontal) | ||
.background(Color(.white)) | ||
.cornerRadius(Layout.featureListCornerRadius) | ||
VStack(alignment: .leading, spacing: Layout.featureListSpacing) { | ||
Text(Localization.paymentsDisclaimerText) | ||
.font(.caption) | ||
Text(Localization.pluginsDisclaimerText) | ||
.font(.caption) | ||
} | ||
.background(Color(.secondarySystemBackground)) | ||
.padding(.top) | ||
} | ||
.padding() | ||
.navigationTitle(Localization.featureListTitleText) | ||
.navigationBarTitleDisplayMode(.inline) | ||
.navigationBarItems(leading: Button(action: { | ||
presentationMode.wrappedValue.dismiss() | ||
}) { | ||
Image(systemName: "chevron.left") | ||
}) | ||
.background(Color(.secondarySystemBackground)) | ||
} | ||
} | ||
|
||
private extension FullFeatureListView { | ||
struct Localization { | ||
static let featureListTitleText = NSLocalizedString( | ||
"Full Feature List", | ||
comment: "Title of the view which shows the full feature list for paid plans.") | ||
|
||
static let performanceOnlyText = NSLocalizedString( | ||
"Performance plan only", | ||
comment: "") | ||
|
||
static let paymentsDisclaimerText = NSLocalizedString( | ||
"1. Available as standard in WooCommerce Payments (restrictions apply)." + | ||
"Additional extensions may be required for other payment providers." , | ||
comment: "Disclaimer regarding some of the features related to payments.") | ||
|
||
static let pluginsDisclaimerText = NSLocalizedString( | ||
"2. Only available in the U.S. – an additional extension will be required for other countries.", | ||
comment: "Disclaimer regarding some of the features related to shipping.") | ||
} | ||
|
||
struct Layout { | ||
static let featureListSpacing: CGFloat = 16.0 | ||
static let featureListCornerRadius: CGFloat = 10.0 | ||
} | ||
} |
279 changes: 279 additions & 0 deletions
279
WooCommerce/Classes/ViewRelated/Upgrades/FullFeatureListViewModel.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,279 @@ | ||
import Foundation | ||
import SwiftUI | ||
|
||
struct FullFeatureListGroups { | ||
public let title: String | ||
public let essentialFeatures: [String] | ||
public let performanceFeatures: [String] | ||
} | ||
|
||
struct FullFeatureListViewModel { | ||
static func hardcodedFullFeatureList() -> [FullFeatureListGroups] { | ||
return [ | ||
FullFeatureListGroups(title: Localization.yourStoreFeatureTitle, | ||
essentialFeatures: [ | ||
Localization.wooCommerceStoreText, | ||
Localization.wooCommerceMobileAppText, | ||
Localization.wordPressCMSText, | ||
Localization.wordPressMobileAppText, | ||
Localization.freeSSLCertificateText, | ||
Localization.generousStorageText, | ||
Localization.automatedBackupQuickRestoreText, | ||
Localization.adFreeExperienceText, | ||
Localization.unlimitedAdminAccountsText, | ||
Localization.liveChatSupportText, | ||
Localization.emailSupportText, | ||
Localization.premiumThemesIncludedText, | ||
Localization.salesReportsText, | ||
Localization.googleAnalyticsText, | ||
], | ||
performanceFeatures: [] | ||
), | ||
FullFeatureListGroups(title: Localization.productsFeatureTitle, | ||
essentialFeatures: [ | ||
Localization.listUnlimitedProducts, | ||
Localization.giftCards, | ||
Localization.listProductsByBrand, | ||
], | ||
performanceFeatures: [ | ||
Localization.minMaxOrderQuantityText, | ||
Localization.productBundlesText, | ||
Localization.customProductKitsText, | ||
Localization.productRecommendationsText, | ||
]), | ||
FullFeatureListGroups(title: Localization.paymentsFeatureTitle, | ||
essentialFeatures: [ | ||
Localization.integratedPayments, | ||
Localization.internationalPayments, | ||
Localization.automatedSalesTaxes, | ||
Localization.acceptLocalPayments, | ||
Localization.recurringPayments, | ||
], | ||
performanceFeatures: []), | ||
|
||
FullFeatureListGroups(title: Localization.marketingAndEmailFeatureTitle, | ||
essentialFeatures: [ | ||
Localization.promoteOnTikTok, | ||
Localization.syncWithPinterest, | ||
Localization.connectWithFacebook, | ||
Localization.advancedSeoTools, | ||
Localization.advertiseOnGoogle, | ||
Localization.customOrderEmails, | ||
], | ||
performanceFeatures: [ | ||
Localization.backInStockEmailsText, | ||
Localization.marketingAutomationText, | ||
Localization.abandonedCartRecoveryText, | ||
Localization.referralProgramsText, | ||
Localization.customerBirthdayEmailsText, | ||
Localization.loyaltyPointsProgramsText, | ||
]), | ||
|
||
FullFeatureListGroups(title: Localization.shippingFeatureTitle, | ||
essentialFeatures: [ | ||
Localization.shipmentTracking, | ||
Localization.liveShippingRates, | ||
Localization.printShippingLabels | ||
], | ||
performanceFeatures: [ | ||
Localization.discountedShippingText, | ||
]), | ||
] | ||
} | ||
} | ||
|
||
private extension FullFeatureListViewModel { | ||
static let featureGroupTitleComment = "The title of one of the feature groups offered with paid plans" | ||
static let essentialFeatureTitleComment = "The title of one of the features offered with the Essential plan" | ||
static let performanceFeatureTitleComment = "The title of one of the features offered with the Performance plan" | ||
|
||
struct Localization { | ||
static let yourStoreFeatureTitle = NSLocalizedString( | ||
"Your Store", | ||
comment: featureGroupTitleComment) | ||
|
||
static let productsFeatureTitle = NSLocalizedString( | ||
"Products", | ||
comment: featureGroupTitleComment) | ||
|
||
static let paymentsFeatureTitle = NSLocalizedString( | ||
"Payments", | ||
comment: featureGroupTitleComment) | ||
|
||
static let marketingAndEmailFeatureTitle = NSLocalizedString( | ||
"Marketing & Email", | ||
comment: featureGroupTitleComment) | ||
|
||
static let shippingFeatureTitle = NSLocalizedString( | ||
"Shipping", | ||
comment: featureGroupTitleComment) | ||
|
||
static let wooCommerceStoreText = NSLocalizedString( | ||
"WooCommerce store", | ||
comment: essentialFeatureTitleComment) | ||
|
||
static let wooCommerceMobileAppText = NSLocalizedString( | ||
"WooCommerce mobile app", | ||
comment: essentialFeatureTitleComment) | ||
|
||
static let wordPressCMSText = NSLocalizedString( | ||
"WordPress CMS", | ||
comment: essentialFeatureTitleComment) | ||
|
||
static let wordPressMobileAppText = NSLocalizedString( | ||
"WordPress mobile app", | ||
comment: essentialFeatureTitleComment) | ||
|
||
static let freeSSLCertificateText = NSLocalizedString( | ||
"Free SSL certificate", | ||
comment: essentialFeatureTitleComment) | ||
|
||
static let generousStorageText = NSLocalizedString( | ||
"Generous storage", | ||
comment: essentialFeatureTitleComment) | ||
|
||
static let automatedBackupQuickRestoreText = NSLocalizedString( | ||
"Automated backup + quick restore", | ||
comment: essentialFeatureTitleComment) | ||
|
||
static let adFreeExperienceText = NSLocalizedString( | ||
"Ad-free experience", | ||
comment: essentialFeatureTitleComment) | ||
|
||
static let unlimitedAdminAccountsText = NSLocalizedString( | ||
"Unlimited admin accounts", | ||
comment: essentialFeatureTitleComment) | ||
|
||
static let liveChatSupportText = NSLocalizedString( | ||
"Live chat support", | ||
comment: essentialFeatureTitleComment) | ||
|
||
static let emailSupportText = NSLocalizedString( | ||
"Email support", | ||
comment: essentialFeatureTitleComment) | ||
|
||
static let premiumThemesIncludedText = NSLocalizedString( | ||
"Premium themes included", | ||
comment: essentialFeatureTitleComment) | ||
|
||
static let salesReportsText = NSLocalizedString( | ||
"Sales reports", | ||
comment: essentialFeatureTitleComment) | ||
|
||
static let googleAnalyticsText = NSLocalizedString( | ||
"Google Analytics", | ||
comment: essentialFeatureTitleComment) | ||
|
||
static let listUnlimitedProducts = NSLocalizedString( | ||
"List unlimited products", | ||
comment: essentialFeatureTitleComment) | ||
|
||
static let giftCards = NSLocalizedString( | ||
"Gift cards", | ||
comment: essentialFeatureTitleComment) | ||
|
||
static let listProductsByBrand = NSLocalizedString( | ||
"List products by brand", | ||
comment: essentialFeatureTitleComment) | ||
|
||
static let integratedPayments = NSLocalizedString( | ||
"Integrated payments", | ||
comment: essentialFeatureTitleComment) | ||
|
||
static let internationalPayments = NSLocalizedString( | ||
"International payments'", | ||
comment: essentialFeatureTitleComment) | ||
|
||
static let automatedSalesTaxes = NSLocalizedString( | ||
"Automated sales taxes", | ||
comment: essentialFeatureTitleComment) | ||
|
||
static let acceptLocalPayments = NSLocalizedString( | ||
"Accept local payments'", | ||
comment: essentialFeatureTitleComment) | ||
|
||
static let recurringPayments = NSLocalizedString( | ||
"Recurring payments'", | ||
comment: essentialFeatureTitleComment) | ||
|
||
static let promoteOnTikTok = NSLocalizedString( | ||
"Promote on TikTok", | ||
comment: essentialFeatureTitleComment) | ||
|
||
static let syncWithPinterest = NSLocalizedString( | ||
"Sync with Pinterest", | ||
comment: essentialFeatureTitleComment) | ||
|
||
static let connectWithFacebook = NSLocalizedString( | ||
"Connect with Facebook", | ||
comment: essentialFeatureTitleComment) | ||
|
||
static let advancedSeoTools = NSLocalizedString( | ||
"Advanced SEO tools", | ||
comment: essentialFeatureTitleComment) | ||
|
||
static let advertiseOnGoogle = NSLocalizedString( | ||
"Advertise on Google", | ||
comment: essentialFeatureTitleComment) | ||
|
||
static let customOrderEmails = NSLocalizedString( | ||
"Custom order emails", | ||
comment: essentialFeatureTitleComment) | ||
|
||
static let shipmentTracking = NSLocalizedString( | ||
"Shipment tracking", | ||
comment: essentialFeatureTitleComment) | ||
|
||
static let liveShippingRates = NSLocalizedString( | ||
"Live shipping rates", | ||
comment: essentialFeatureTitleComment) | ||
|
||
static let printShippingLabels = NSLocalizedString( | ||
"Print shipping labels²", | ||
comment: essentialFeatureTitleComment) | ||
|
||
static let minMaxOrderQuantityText = NSLocalizedString( | ||
"Min/Max order quantity", | ||
comment: performanceFeatureTitleComment) | ||
|
||
static let productBundlesText = NSLocalizedString( | ||
"Product Bundles", | ||
comment: performanceFeatureTitleComment) | ||
|
||
static let customProductKitsText = NSLocalizedString( | ||
"Custom product kits", | ||
comment: performanceFeatureTitleComment) | ||
|
||
static let productRecommendationsText = NSLocalizedString( | ||
"Product recommendations", | ||
comment: performanceFeatureTitleComment) | ||
|
||
static let backInStockEmailsText = NSLocalizedString( | ||
"Back in stock emails", | ||
comment: performanceFeatureTitleComment) | ||
|
||
static let marketingAutomationText = NSLocalizedString( | ||
"Marketing automation", | ||
comment: performanceFeatureTitleComment) | ||
|
||
static let abandonedCartRecoveryText = NSLocalizedString( | ||
"Abandoned cart recovery", | ||
comment: performanceFeatureTitleComment) | ||
|
||
static let referralProgramsText = NSLocalizedString( | ||
"Referral programs", | ||
comment: performanceFeatureTitleComment) | ||
|
||
static let customerBirthdayEmailsText = NSLocalizedString( | ||
"Customer birthday emails", | ||
comment: performanceFeatureTitleComment) | ||
|
||
static let loyaltyPointsProgramsText = NSLocalizedString( | ||
"Loyalty points programs", | ||
comment: performanceFeatureTitleComment) | ||
|
||
static let discountedShippingText = NSLocalizedString( | ||
"Discounted shipping²", | ||
comment: performanceFeatureTitleComment) | ||
} | ||
} |
Oops, something went wrong.