Skip to content

Commit

Permalink
Use a custom view to render Privacy Pro Cells
Browse files Browse the repository at this point in the history
  • Loading branch information
afterxleep committed Dec 12, 2023
1 parent b724c35 commit 224c683
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 9 deletions.
22 changes: 20 additions & 2 deletions DuckDuckGo/SettingsPrivacyProView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,29 @@ struct SettingsPrivacyProView: View {

@EnvironmentObject var viewModel: SettingsViewModel

private var privacyProDescriptionView: some View {
VStack(alignment: .leading) {
Text(UserText.settingsPProSubscribe).daxBodyRegular()
Group {
Text(UserText.settingsPProDescription).daxFootnoteRegular().padding(.bottom, 5)
Text(UserText.settingsPProFeatures).daxFootnoteRegular()
}.foregroundColor(Color(designSystemColor: .textSecondary))
}
}

private var learnMoreView: some View {
Text(UserText.settingsPProLearnMore)
.daxBodyRegular()
.foregroundColor(Color.init(designSystemColor: .accent))
}

var body: some View {
Section(header: Text(UserText.settingsPrivacySection)) {
SettingsCellView(label: UserText.settingsPProSubscribe, subtitle: UserText.settingsPProDescription)

SettingsCustomCell(content: { privacyProDescriptionView })

NavigationLink(destination: SubscriptionFlowView(viewModel: SubscriptionFlowViewModel())) {
SettingsCellView(label: UserText.settingsPProLearnMore)
SettingsCustomCell(content: { learnMoreView })
}
}
}
Expand Down
7 changes: 3 additions & 4 deletions DuckDuckGo/UserText.swift
Original file line number Diff line number Diff line change
Expand Up @@ -951,14 +951,13 @@ But if you *do* want a peek under the hood, you can find more information about
// Privacy Pro Section
public static let settingsPProSection = NSLocalizedString("settings.ppro", value: "Privacy Pro", comment: "Product name for the subscription bundle")
public static let settingsPProSubscribe = NSLocalizedString("settings.ppro.subscribe", value: "Subscribe to Privacy Pro", comment: "Call to action title for Privacy Pro")
public static let settingsPProDescription = NSLocalizedString("settings.ppro.description", value:
public static let settingsPProDescription = NSLocalizedString("settings.ppro.description", value:"More seamless privacy with three new protections, including:", comment: "Privacy pro description subtext")
public static let settingsPProFeatures = NSLocalizedString("settings.ppro.features", value:
"""
More seamless privacy with three new protections, including:
• VPN (Virtual Private Network)
• Personal Information Removal
• Identity Theft Restoration
""", comment: "about page")
""", comment: "Privacy pro features list")

public static let settingsPProLearnMore = NSLocalizedString("settings.ppro.learn.more", value: "Learn More", comment: "Learn more button text for privacy pro")

Expand Down
7 changes: 4 additions & 3 deletions DuckDuckGo/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -1813,10 +1813,11 @@ But if you *do* want a peek under the hood, you can find more information about
/* Product name for the subscription bundle */
"settings.ppro" = "Privacy Pro";

/* about page */
"settings.ppro.description" = "More seamless privacy with three new protections, including:
/* Privacy pro description subtext */
"settings.ppro.description" = "More seamless privacy with three new protections, including:";

• VPN (Virtual Private Network)
/* Privacy pro features list */
"settings.ppro.features" = " • VPN (Virtual Private Network)
• Personal Information Removal
• Identity Theft Restoration";

Expand Down

0 comments on commit 224c683

Please sign in to comment.