From 384a57a4bd4d2e60188912f7fec4592b41e362c3 Mon Sep 17 00:00:00 2001 From: Trey t Date: Tue, 27 Dec 2022 14:52:01 -0600 Subject: [PATCH] add eula and privacy buttons --- Shared/views/SettingsView/SettingsView.swift | 35 ++++++++++++++++++++ en.lproj/Localizable.strings | 2 ++ 2 files changed, 37 insertions(+) diff --git a/Shared/views/SettingsView/SettingsView.swift b/Shared/views/SettingsView/SettingsView.swift index 84bff38..b2e4e5f 100644 --- a/Shared/views/SettingsView/SettingsView.swift +++ b/Shared/views/SettingsView/SettingsView.swift @@ -12,6 +12,7 @@ import StoreKit struct SettingsView: View { @Environment(\.dismiss) var dismiss + @Environment(\.openURL) var openURL @EnvironmentObject var iapManager: IAPManager @State private var showingExporter = false @@ -41,6 +42,8 @@ struct SettingsView: View { subscriptionInfoView canDelete showOnboardingButton + eulaButton + privacyButton // specialThanksCell } @@ -339,6 +342,38 @@ struct SettingsView: View { .cornerRadius(Constants.viewsCornerRaidus, corners: [.topLeft, .topRight, .bottomLeft, .bottomRight]) } + private var eulaButton: some View { + ZStack { + theme.currentTheme.secondaryBGColor + Button(action: { + EventLogger.log(event: "show_eula") + openURL(URL(string: "https://ifeels.app/eula.html")!) + }, label: { + Text(String(localized: "settings_view_show_eula")) + .foregroundColor(textColor) + }) + .padding() + } + .fixedSize(horizontal: false, vertical: true) + .cornerRadius(Constants.viewsCornerRaidus, corners: [.topLeft, .topRight, .bottomLeft, .bottomRight]) + } + + private var privacyButton: some View { + ZStack { + theme.currentTheme.secondaryBGColor + Button(action: { + EventLogger.log(event: "show_privacy") + openURL(URL(string: "https://ifeels.app/privacy.html")!) + }, label: { + Text(String(localized: "settings_view_show_privacy")) + .foregroundColor(textColor) + }) + .padding() + } + .fixedSize(horizontal: false, vertical: true) + .cornerRadius(Constants.viewsCornerRaidus, corners: [.topLeft, .topRight, .bottomLeft, .bottomRight]) + } + private var cloudKitEnable: some View { ZStack { theme.currentTheme.secondaryBGColor diff --git a/en.lproj/Localizable.strings b/en.lproj/Localizable.strings index b6af793..880b426 100644 --- a/en.lproj/Localizable.strings +++ b/en.lproj/Localizable.strings @@ -49,6 +49,8 @@ "settings_view_special_thanks_to_title" = "Special thanks"; "settings_view_show_onboarding" = "Show onboarding"; "settings_use_delete_enable" = "Allow deletion of entry"; +"settings_view_show_eula" = "EULA"; +"settings_view_show_privacy" = "Privacy Policy"; "mood_value_great" = "Great"; "mood_value_good" = "Good";