SettingsComponents.swift 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. import SwiftUI
  2. struct SettingsShareAppButton: View {
  3. let message: String
  4. let url: URL
  5. var body: some View {
  6. ShareLink(item: url, message: Text(message)) {
  7. HStack(spacing: 14) {
  8. Image(systemName: "square.and.arrow.up")
  9. .font(.system(size: 16, weight: .semibold))
  10. .foregroundStyle(.white)
  11. .frame(width: 40, height: 40)
  12. .background(
  13. RoundedRectangle(cornerRadius: 10)
  14. .fill(AppTheme.accentPurple)
  15. )
  16. VStack(alignment: .leading, spacing: 2) {
  17. Text("Share App")
  18. .font(.system(size: 14, weight: .semibold))
  19. .foregroundStyle(AppTheme.textPrimary)
  20. Text("Tell friends about \(AppLinks.appName)")
  21. .font(.system(size: 11))
  22. .foregroundStyle(AppTheme.textSecondary)
  23. }
  24. Spacer()
  25. Image(systemName: "chevron.right")
  26. .font(.system(size: 11, weight: .semibold))
  27. .foregroundStyle(AppTheme.textTertiary)
  28. }
  29. .padding(14)
  30. .background(
  31. RoundedRectangle(cornerRadius: AppTheme.cornerRadiusSmall)
  32. .fill(AppTheme.cardBackground)
  33. .overlay(
  34. RoundedRectangle(cornerRadius: AppTheme.cornerRadiusSmall)
  35. .stroke(AppTheme.accentPurple.opacity(0.35), lineWidth: 1)
  36. )
  37. )
  38. }
  39. .buttonStyle(.plain)
  40. .frame(maxWidth: .infinity, alignment: .leading)
  41. }
  42. }
  43. struct SettingsLinkRow: View {
  44. let icon: String
  45. let title: String
  46. var subtitle: String?
  47. let action: () -> Void
  48. var body: some View {
  49. Button(action: action) {
  50. HStack(spacing: 12) {
  51. Image(systemName: icon)
  52. .font(.system(size: 14, weight: .medium))
  53. .foregroundStyle(AppTheme.accentPurple)
  54. .frame(width: 32, height: 32)
  55. .background(
  56. RoundedRectangle(cornerRadius: 8)
  57. .fill(AppTheme.accentPurple.opacity(0.12))
  58. )
  59. VStack(alignment: .leading, spacing: 2) {
  60. Text(title)
  61. .font(.system(size: 13, weight: .medium))
  62. .foregroundStyle(AppTheme.textPrimary)
  63. if let subtitle {
  64. Text(subtitle)
  65. .font(.system(size: 10))
  66. .foregroundStyle(AppTheme.textSecondary)
  67. }
  68. }
  69. Spacer()
  70. Image(systemName: "arrow.up.right")
  71. .font(.system(size: 11, weight: .medium))
  72. .foregroundStyle(AppTheme.textTertiary)
  73. }
  74. .padding(.horizontal, 12)
  75. .padding(.vertical, 10)
  76. .background(AppTheme.panelBackground)
  77. .clipShape(RoundedRectangle(cornerRadius: 8))
  78. .overlay(
  79. RoundedRectangle(cornerRadius: 8)
  80. .stroke(AppTheme.cardBorder, lineWidth: 1)
  81. )
  82. }
  83. .buttonStyle(.plain)
  84. .frame(maxWidth: .infinity, alignment: .leading)
  85. }
  86. }