|
@@ -120,6 +120,7 @@ struct LauncherRootView: View {
|
|
|
|
|
|
|
|
PromoBanner(
|
|
PromoBanner(
|
|
|
isPremiumUnlocked: premiumStore.isPremiumUnlocked,
|
|
isPremiumUnlocked: premiumStore.isPremiumUnlocked,
|
|
|
|
|
+ activePremiumProductID: premiumStore.activePremiumProductID,
|
|
|
onCloseTap: {
|
|
onCloseTap: {
|
|
|
if !premiumStore.isPremiumUnlocked {
|
|
if !premiumStore.isPremiumUnlocked {
|
|
|
showingPremiumScreen = true
|
|
showingPremiumScreen = true
|
|
@@ -833,6 +834,7 @@ private func encodeUUIDSetGlobal(_ set: Set<UUID>) -> String {
|
|
|
|
|
|
|
|
private struct PromoBanner: View {
|
|
private struct PromoBanner: View {
|
|
|
let isPremiumUnlocked: Bool
|
|
let isPremiumUnlocked: Bool
|
|
|
|
|
+ let activePremiumProductID: PremiumProductID?
|
|
|
let onCloseTap: () -> Void
|
|
let onCloseTap: () -> Void
|
|
|
let onUpgradeTap: () -> Void
|
|
let onUpgradeTap: () -> Void
|
|
|
let onManageSubscriptionTap: () -> Void
|
|
let onManageSubscriptionTap: () -> Void
|
|
@@ -853,18 +855,48 @@ private struct PromoBanner: View {
|
|
|
|
|
|
|
|
Spacer()
|
|
Spacer()
|
|
|
|
|
|
|
|
- Button(action: isPremiumUnlocked ? onManageSubscriptionTap : onUpgradeTap) {
|
|
|
|
|
- Text(isPremiumUnlocked ? "Manage Subscription" : "Upgrade")
|
|
|
|
|
- .font(.system(size: 13, weight: .semibold))
|
|
|
|
|
- .foregroundStyle(.white)
|
|
|
|
|
- .padding(.horizontal, 12)
|
|
|
|
|
- .padding(.vertical, 6)
|
|
|
|
|
- .background(
|
|
|
|
|
- Capsule(style: .continuous)
|
|
|
|
|
- .fill(Color.blue.opacity(0.92))
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ HStack(spacing: 8) {
|
|
|
|
|
+ if isPremiumUnlocked && activePremiumProductID == .yearly {
|
|
|
|
|
+ Button(action: onUpgradeTap) {
|
|
|
|
|
+ Text("Upgrade Plan")
|
|
|
|
|
+ .font(.system(size: 13, weight: .semibold))
|
|
|
|
|
+ .foregroundStyle(.white)
|
|
|
|
|
+ .padding(.horizontal, 12)
|
|
|
|
|
+ .padding(.vertical, 6)
|
|
|
|
|
+ .background(
|
|
|
|
|
+ Capsule(style: .continuous)
|
|
|
|
|
+ .fill(Color(red: 1.0, green: 0.67, blue: 0.2).opacity(0.95))
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
+ .buttonStyle(.plain)
|
|
|
|
|
+
|
|
|
|
|
+ Button(action: onManageSubscriptionTap) {
|
|
|
|
|
+ Text("Manage Subscription")
|
|
|
|
|
+ .font(.system(size: 13, weight: .semibold))
|
|
|
|
|
+ .foregroundStyle(.white)
|
|
|
|
|
+ .padding(.horizontal, 12)
|
|
|
|
|
+ .padding(.vertical, 6)
|
|
|
|
|
+ .background(
|
|
|
|
|
+ Capsule(style: .continuous)
|
|
|
|
|
+ .fill(Color.blue.opacity(0.92))
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
+ .buttonStyle(.plain)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ Button(action: isPremiumUnlocked ? onManageSubscriptionTap : onUpgradeTap) {
|
|
|
|
|
+ Text(isPremiumUnlocked ? "Manage Subscription" : "Upgrade")
|
|
|
|
|
+ .font(.system(size: 13, weight: .semibold))
|
|
|
|
|
+ .foregroundStyle(.white)
|
|
|
|
|
+ .padding(.horizontal, 12)
|
|
|
|
|
+ .padding(.vertical, 6)
|
|
|
|
|
+ .background(
|
|
|
|
|
+ Capsule(style: .continuous)
|
|
|
|
|
+ .fill(Color.blue.opacity(0.92))
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
+ .buttonStyle(.plain)
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- .buttonStyle(.plain)
|
|
|
|
|
}
|
|
}
|
|
|
.padding(.horizontal, 11)
|
|
.padding(.horizontal, 11)
|
|
|
.padding(.vertical, 8)
|
|
.padding(.vertical, 8)
|