Skip to content

Commit

Permalink
Add terms of service link to settings
Browse files Browse the repository at this point in the history
  • Loading branch information
bwaresiak committed May 30, 2024
1 parent 6bb897b commit 096f03f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
17 changes: 11 additions & 6 deletions DuckDuckGo/SettingsSubscriptionView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,17 @@ struct SettingsSubscriptionView: View {
@State var isShowingGoogleView = false
@State var isShowingStripeView = false
@State var isShowingSubscriptionError = false
@State var isShowingPrivacyPro = false
@State var isShowingPrivacyPro = true

enum Constants {
static let purchaseDescriptionPadding = 5.0
static let topCellPadding = 3.0
static let noEntitlementsIconWidth = 20.0
static let navigationDelay = 0.3
static let infoIcon = "info-16"
static let alertIcon = "Exclamation-Color-16"

static let privacyPolicyURL = URL(string: "https://duckduckgo.com/pro/privacy-terms")!
}

private var subscriptionDescriptionView: some View {
Expand Down Expand Up @@ -214,9 +216,12 @@ struct SettingsSubscriptionView: View {
var body: some View {
Group {
if isShowingPrivacyPro {

Section(header: Text(UserText.settingsPProSection)) {

let footerLink = Link(UserText.settingsPProSectionFooter,
destination: Constants.privacyPolicyURL
).daxFootnoteRegular().accentColor(Color.init(designSystemColor: .accent))

Section(header: Text(UserText.settingsPProSection), footer: footerLink) {

switch (
viewModel.state.subscription.isSignedIn,
viewModel.state.subscription.hasActiveSubscription,
Expand Down Expand Up @@ -253,7 +258,7 @@ struct SettingsSubscriptionView: View {
isShowingSubscribeFlow = false
}
}

}
}.onReceive(viewModel.$state) { state in
if state.subscription.enabled && state.subscription.canPurchase {
Expand Down
2 changes: 2 additions & 0 deletions DuckDuckGo/UserText.swift
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,8 @@ But if you *do* want a peek under the hood, you can find more information about

// Subscription Section
public static let settingsPProSection = NSLocalizedString("settings.ppro", value: "Privacy Pro", comment: "Product name for the subscription bundle")
public static let settingsPProSectionFooter = NSLocalizedString("settings.ppro.footer", value: "Privacy Policy and Terms of Service", comment: "Title for Link in the Footer of Privacy Pro section")

public static let settingsPProSubscribe = NSLocalizedString("settings.subscription.subscribe", value: "Subscribe to Privacy Pro", comment: "Call to action title for Privacy Pro")
public static let settingsPProDescription = NSLocalizedString("settings.subscription.description", value:"More seamless privacy with three new protections:", comment: "Privacy pro description subtext")
public static let settingsPProFeatures = NSLocalizedString("settings.subscription.features", value:
Expand Down
3 changes: 3 additions & 0 deletions DuckDuckGo/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -1871,6 +1871,9 @@ 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";

/* Title for Link in the Footer of Privacy Pro section */
"settings.ppro.footer" = "Privacy Policy and Terms of Service";

/* Settings screen cell for long press previews */
"settings.previews" = "Long-Press Previews";

Expand Down

0 comments on commit 096f03f

Please sign in to comment.