Use premiumToggle helper for Center Stage, remove dead premiumSectionHeader code
This commit is contained in:
parent
5cab79f426
commit
a3d7370f32
@ -73,7 +73,12 @@ struct SettingsView: View {
|
||||
hdrModePicker
|
||||
|
||||
// Center Stage (premium feature)
|
||||
centerStageToggle
|
||||
premiumToggle(
|
||||
title: String(localized: "Center Stage"),
|
||||
subtitle: String(localized: "Automatically keeps you centered in the frame"),
|
||||
isOn: $viewModel.isCenterStageEnabled,
|
||||
accessibilityHint: String(localized: "Automatically adjusts camera to keep subject centered")
|
||||
)
|
||||
|
||||
// Photo Quality
|
||||
photoQualityPicker
|
||||
@ -379,41 +384,6 @@ struct SettingsView: View {
|
||||
.accessibilityValue("\(Int(viewModel.ringLightOpacity * 100)) percent")
|
||||
}
|
||||
|
||||
// MARK: - Center Stage Toggle
|
||||
|
||||
private var centerStageToggle: some View {
|
||||
Toggle(isOn: $viewModel.isCenterStageEnabled) {
|
||||
VStack(alignment: .leading, spacing: Design.Spacing.xxSmall) {
|
||||
HStack(spacing: Design.Spacing.xSmall) {
|
||||
Text(String(localized: "Center Stage"))
|
||||
.font(.system(size: Design.BaseFontSize.medium, weight: .medium))
|
||||
.foregroundStyle(.white)
|
||||
|
||||
Image(systemName: "crown.fill")
|
||||
.font(.system(size: Design.BaseFontSize.small))
|
||||
.foregroundStyle(AppStatus.warning)
|
||||
}
|
||||
|
||||
Text(String(localized: "Automatically keeps you centered in the frame"))
|
||||
.font(.system(size: Design.BaseFontSize.body))
|
||||
.foregroundStyle(.white.opacity(Design.Opacity.medium))
|
||||
}
|
||||
}
|
||||
.tint(AppAccent.primary)
|
||||
.padding(.vertical, Design.Spacing.xSmall)
|
||||
.disabled(!isPremiumUnlocked)
|
||||
.accessibilityLabel(String(localized: "Enable Center Stage"))
|
||||
.accessibilityHint(String(localized: "Automatically adjusts camera to keep subject centered"))
|
||||
.onTapGesture {
|
||||
if !isPremiumUnlocked {
|
||||
dismiss()
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
|
||||
showPaywall = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Timer Picker (5s/10s are Premium)
|
||||
|
||||
private var timerPicker: some View {
|
||||
@ -572,37 +542,6 @@ struct SettingsView: View {
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Premium Section Header Helper
|
||||
|
||||
/// Creates a section header with premium indicator (crown icon)
|
||||
/// - Parameters:
|
||||
/// - title: The section title
|
||||
/// - systemImage: The SF Symbol name for the section icon
|
||||
/// - Returns: A view containing the premium section header
|
||||
@ViewBuilder
|
||||
private func premiumSectionHeader(title: String, systemImage: String) -> some View {
|
||||
HStack(spacing: Design.Spacing.small) {
|
||||
Image(systemName: systemImage)
|
||||
.font(.system(size: Design.BaseFontSize.medium))
|
||||
.foregroundStyle(.white.opacity(Design.Opacity.accent))
|
||||
|
||||
Text(title)
|
||||
.font(.system(size: Design.BaseFontSize.caption, weight: .semibold))
|
||||
.foregroundStyle(.white.opacity(Design.Opacity.accent))
|
||||
.textCase(.uppercase)
|
||||
.tracking(0.5)
|
||||
|
||||
Image(systemName: "crown.fill")
|
||||
.font(.system(size: Design.BaseFontSize.small))
|
||||
.foregroundStyle(AppStatus.warning)
|
||||
|
||||
Spacer()
|
||||
}
|
||||
.padding(.horizontal, Design.Spacing.xSmall)
|
||||
.padding(.top, Design.Spacing.large)
|
||||
.padding(.bottom, Design.Spacing.xSmall)
|
||||
}
|
||||
|
||||
// MARK: - Branding Debug Section
|
||||
|
||||
#if DEBUG
|
||||
|
||||
Loading…
Reference in New Issue
Block a user