Jonas Björkert 1 год назад
Родитель
Сommit
52af22333a
1 измененных файлов с 40 добавлено и 7 удалено
  1. 40 7
      LoopFollow/Settings/SettingsMenuView.swift

+ 40 - 7
LoopFollow/Settings/SettingsMenuView.swift

@@ -3,6 +3,7 @@
 // Created by Jonas Björkert on 2025-05-26.
 
 import SwiftUI
+import UIKit
 
 struct SettingsMenuView: View {
     // MARK: – Call-backs -----------------------------------------------------
@@ -153,15 +154,27 @@ struct SettingsMenuView: View {
     // MARK: – Row helpers ----------------------------------------------------
 
     /// Standard row with icon, chevron and sheet presentation
-    private func navRow(title: String,
-                        icon: String,
-                        destination: Sheet) -> some View
-    {
-        NavigationLink {
-            destination.destination
+    /// One tappable row, styled like the iOS Settings app
+    @ViewBuilder
+    private func navRow(
+        title: String,
+        icon: String,
+        tint: Color = .primary,
+        destination: Sheet
+    ) -> some View {
+        Button {
+            sheet = destination
         } label: {
-            Label(title, systemImage: icon)
+            HStack {
+                Glyph(symbol: icon, tint: tint)
+                Text(title)
+                Spacer()
+                Image(systemName: "chevron.right")
+                    .foregroundColor(Color(uiColor: .tertiaryLabel))
+            }
+            .contentShape(Rectangle())
         }
+        .buttonStyle(.plain)
     }
 
     /// Simple key-value row
@@ -258,3 +271,23 @@ extension UIViewController {
         present(a, animated: true)
     }
 }
+
+struct Glyph: View {
+    let symbol: String
+    let tint: Color
+
+    @Environment(\.colorScheme) private var scheme
+
+    var body: some View {
+        ZStack {
+            RoundedRectangle(cornerRadius: 8, style: .continuous)
+                .fill(Color(uiColor: .systemGray))
+                .frame(width: 28, height: 28)
+
+            Image(systemName: symbol)
+                .font(.system(size: 16, weight: .regular))
+                .foregroundStyle(tint)
+        }
+        .frame(width: 36, height: 36)
+    }
+}