|
@@ -45,6 +45,10 @@ struct PaywallView: View {
|
|
|
ProgressView()
|
|
ProgressView()
|
|
|
.controlSize(.large)
|
|
.controlSize(.large)
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ if isPremium {
|
|
|
|
|
+ closeButton(metrics: metrics)
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
|
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
|
@@ -67,6 +71,33 @@ struct PaywallView: View {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private func closeButton(metrics: PaywallLayoutMetrics) -> some View {
|
|
|
|
|
+ VStack {
|
|
|
|
|
+ HStack {
|
|
|
|
|
+ Spacer()
|
|
|
|
|
+ Button(action: onDismiss) {
|
|
|
|
|
+ Image(systemName: "xmark")
|
|
|
|
|
+ .font(.system(size: metrics.closeButtonSize, weight: .medium))
|
|
|
|
|
+ .foregroundStyle(AppTheme.textSecondary)
|
|
|
|
|
+ .frame(width: metrics.closeButtonHitArea, height: metrics.closeButtonHitArea)
|
|
|
|
|
+ .background(
|
|
|
|
|
+ Circle()
|
|
|
|
|
+ .fill(AppTheme.cardBackground)
|
|
|
|
|
+ .overlay(
|
|
|
|
|
+ Circle()
|
|
|
|
|
+ .stroke(AppTheme.cardBorder, lineWidth: 1)
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
+ .buttonStyle(.plain)
|
|
|
|
|
+ .help("Close")
|
|
|
|
|
+ }
|
|
|
|
|
+ Spacer()
|
|
|
|
|
+ }
|
|
|
|
|
+ .padding(.horizontal, metrics.horizontalInset)
|
|
|
|
|
+ .padding(.top, metrics.topInset * 0.45)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private func header(metrics: PaywallLayoutMetrics) -> some View {
|
|
private func header(metrics: PaywallLayoutMetrics) -> some View {
|
|
|
VStack(spacing: metrics.headerSpacing) {
|
|
VStack(spacing: metrics.headerSpacing) {
|
|
|
Text(PaywallContent.title)
|
|
Text(PaywallContent.title)
|
|
@@ -243,6 +274,8 @@ private struct PaywallLayoutMetrics {
|
|
|
var cardPadding: CGFloat { size.width * 0.014 }
|
|
var cardPadding: CGFloat { size.width * 0.014 }
|
|
|
var cornerRadius: CGFloat { clamp(size.height * 0.014, min: 8, max: 12) }
|
|
var cornerRadius: CGFloat { clamp(size.height * 0.014, min: 8, max: 12) }
|
|
|
var ctaVerticalPadding: CGFloat { size.height * 0.022 }
|
|
var ctaVerticalPadding: CGFloat { size.height * 0.022 }
|
|
|
|
|
+ var closeButtonSize: CGFloat { clamp(size.height * 0.016, min: 10, max: 14) }
|
|
|
|
|
+ var closeButtonHitArea: CGFloat { clamp(size.height * 0.038, min: 28, max: 36) }
|
|
|
|
|
|
|
|
var featureColumns: [GridItem] {
|
|
var featureColumns: [GridItem] {
|
|
|
[
|
|
[
|