From a3d7370f3215d87aaba469178271a5ab83842b41 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Sun, 4 Jan 2026 18:20:58 -0600 Subject: [PATCH] Use premiumToggle helper for Center Stage, remove dead premiumSectionHeader code --- .../Features/Settings/SettingsView.swift | 73 ++----------------- 1 file changed, 6 insertions(+), 67 deletions(-) diff --git a/SelfieCam/Features/Settings/SettingsView.swift b/SelfieCam/Features/Settings/SettingsView.swift index af562cb..c382ff0 100644 --- a/SelfieCam/Features/Settings/SettingsView.swift +++ b/SelfieCam/Features/Settings/SettingsView.swift @@ -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