| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- import SwiftUI
- struct SettingsShareAppButton: View {
- let message: String
- let url: URL
- var body: some View {
- ShareLink(item: url, message: Text(message)) {
- HStack(spacing: 14) {
- Image(systemName: "square.and.arrow.up")
- .font(.system(size: 16, weight: .semibold))
- .foregroundStyle(.white)
- .frame(width: 40, height: 40)
- .background(
- RoundedRectangle(cornerRadius: 10)
- .fill(AppTheme.accentPurple)
- )
- VStack(alignment: .leading, spacing: 2) {
- Text("Share App")
- .font(.system(size: 14, weight: .semibold))
- .foregroundStyle(AppTheme.textPrimary)
- Text("Tell friends about \(AppLinks.appName)")
- .font(.system(size: 11))
- .foregroundStyle(AppTheme.textSecondary)
- }
- Spacer()
- Image(systemName: "chevron.right")
- .font(.system(size: 11, weight: .semibold))
- .foregroundStyle(AppTheme.textTertiary)
- }
- .padding(14)
- .background(
- RoundedRectangle(cornerRadius: AppTheme.cornerRadiusSmall)
- .fill(AppTheme.cardBackground)
- .overlay(
- RoundedRectangle(cornerRadius: AppTheme.cornerRadiusSmall)
- .stroke(AppTheme.accentPurple.opacity(0.35), lineWidth: 1)
- )
- )
- }
- .buttonStyle(AppPlainButtonStyle())
- .hoverCard(cornerRadius: AppTheme.cornerRadiusSmall)
- .frame(maxWidth: .infinity, alignment: .leading)
- }
- }
- struct SettingsToggleRow: View {
- let icon: String
- let title: String
- var subtitle: String?
- @Binding var isOn: Bool
- var body: some View {
- HStack(spacing: 12) {
- Image(systemName: icon)
- .font(.system(size: 14, weight: .medium))
- .foregroundStyle(AppTheme.accentPurple)
- .frame(width: 32, height: 32)
- .background(
- RoundedRectangle(cornerRadius: 8)
- .fill(AppTheme.accentPurple.opacity(0.12))
- )
- VStack(alignment: .leading, spacing: 2) {
- Text(title)
- .font(.system(size: 13, weight: .medium))
- .foregroundStyle(AppTheme.textPrimary)
- if let subtitle {
- Text(subtitle)
- .font(.system(size: 10))
- .foregroundStyle(AppTheme.textSecondary)
- }
- }
- Spacer()
- Toggle("", isOn: $isOn)
- .labelsHidden()
- .toggleStyle(.switch)
- }
- .padding(.horizontal, 12)
- .padding(.vertical, 10)
- .background(AppTheme.panelBackground)
- .clipShape(RoundedRectangle(cornerRadius: 8))
- .overlay(
- RoundedRectangle(cornerRadius: 8)
- .stroke(AppTheme.cardBorder, lineWidth: 1)
- )
- .frame(maxWidth: .infinity, alignment: .leading)
- }
- }
- struct SettingsLinkRow: View {
- let icon: String
- let title: String
- var subtitle: String?
- let action: () -> Void
- var body: some View {
- Button(action: action) {
- HStack(spacing: 12) {
- Image(systemName: icon)
- .font(.system(size: 14, weight: .medium))
- .foregroundStyle(AppTheme.accentPurple)
- .frame(width: 32, height: 32)
- .background(
- RoundedRectangle(cornerRadius: 8)
- .fill(AppTheme.accentPurple.opacity(0.12))
- )
- VStack(alignment: .leading, spacing: 2) {
- Text(title)
- .font(.system(size: 13, weight: .medium))
- .foregroundStyle(AppTheme.textPrimary)
- if let subtitle {
- Text(subtitle)
- .font(.system(size: 10))
- .foregroundStyle(AppTheme.textSecondary)
- }
- }
- Spacer()
- Image(systemName: "arrow.up.right")
- .font(.system(size: 11, weight: .medium))
- .foregroundStyle(AppTheme.textTertiary)
- }
- .padding(.horizontal, 12)
- .padding(.vertical, 10)
- .background(AppTheme.panelBackground)
- .clipShape(RoundedRectangle(cornerRadius: 8))
- .overlay(
- RoundedRectangle(cornerRadius: 8)
- .stroke(AppTheme.cardBorder, lineWidth: 1)
- )
- }
- .buttonStyle(AppPlainButtonStyle())
- .hoverCard(cornerRadius: 8)
- .frame(maxWidth: .infinity, alignment: .leading)
- }
- }
|