|
|
@@ -1,5 +1,6 @@
|
|
|
import StoreKit
|
|
|
import SwiftUI
|
|
|
+import AppKit
|
|
|
|
|
|
struct PremiumFeaturesView: View {
|
|
|
/// When presented from AppKit (`NSWindow.beginSheet`), use this to dismiss; SwiftUI `dismiss` may not close the sheet.
|
|
|
@@ -22,6 +23,12 @@ struct PremiumFeaturesView: View {
|
|
|
@Environment(\.colorScheme) private var colorScheme
|
|
|
@State private var selectedPlan: PlanOption = .perpetual
|
|
|
@State private var showingSuccessAlert = false
|
|
|
+
|
|
|
+ private enum ExternalPage {
|
|
|
+ static let terms = "https://sites.google.com/view/gogleapps/terms-of-service"
|
|
|
+ static let privacy = "https://sites.google.com/view/gogleapps/privacy-policy"
|
|
|
+ static let support = "https://sites.google.com/view/gogleapps/support"
|
|
|
+ }
|
|
|
|
|
|
private let featureRows: [(String, String)] = [
|
|
|
("Desktop Widgets", "Add frequently used apps as desktop widgets"),
|
|
|
@@ -208,17 +215,30 @@ struct PremiumFeaturesView: View {
|
|
|
|
|
|
HStack {
|
|
|
Spacer()
|
|
|
- Text("Privacy Policy")
|
|
|
- .font(.system(size: 11, weight: .medium))
|
|
|
- .foregroundStyle(secondaryTextColor)
|
|
|
+ Button("Privacy Policy") {
|
|
|
+ openExternalPage(ExternalPage.privacy)
|
|
|
+ }
|
|
|
+ .buttonStyle(.plain)
|
|
|
+ .font(.system(size: 11, weight: .medium))
|
|
|
+ .foregroundStyle(secondaryTextColor)
|
|
|
+
|
|
|
Spacer()
|
|
|
- Text("Support")
|
|
|
- .font(.system(size: 11, weight: .medium))
|
|
|
- .foregroundStyle(secondaryTextColor)
|
|
|
+
|
|
|
+ Button("Support") {
|
|
|
+ openExternalPage(ExternalPage.support)
|
|
|
+ }
|
|
|
+ .buttonStyle(.plain)
|
|
|
+ .font(.system(size: 11, weight: .medium))
|
|
|
+ .foregroundStyle(secondaryTextColor)
|
|
|
+
|
|
|
Spacer()
|
|
|
- Text("Terms of Service")
|
|
|
- .font(.system(size: 11, weight: .medium))
|
|
|
- .foregroundStyle(secondaryTextColor)
|
|
|
+
|
|
|
+ Button("Terms of Service") {
|
|
|
+ openExternalPage(ExternalPage.terms)
|
|
|
+ }
|
|
|
+ .buttonStyle(.plain)
|
|
|
+ .font(.system(size: 11, weight: .medium))
|
|
|
+ .foregroundStyle(secondaryTextColor)
|
|
|
Spacer()
|
|
|
}
|
|
|
.padding(.top, 2)
|
|
|
@@ -251,6 +271,11 @@ struct PremiumFeaturesView: View {
|
|
|
dismiss()
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ private func openExternalPage(_ urlString: String) {
|
|
|
+ guard let url = URL(string: urlString) else { return }
|
|
|
+ _ = NSWorkspace.shared.open(url)
|
|
|
+ }
|
|
|
|
|
|
private var backgroundGradientColors: [Color] {
|
|
|
if colorScheme == .dark {
|