Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d75873fa30 | ||
|
|
3095bd106a | ||
|
|
d0c286e7c8 |
@@ -87,9 +87,25 @@ public struct ContentView: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Section("Intelligence") {
|
Section("Intelligence") {
|
||||||
Label("Alerts & Notifications", systemImage: "bell.badge")
|
// Custom row instead of .badge() — a badge applied after .tag
|
||||||
|
// detaches the tag from the list row and makes it unselectable.
|
||||||
|
Label {
|
||||||
|
HStack {
|
||||||
|
Text("Alerts & Notifications")
|
||||||
|
Spacer()
|
||||||
|
if !store.alertEngine.activeAlerts.isEmpty {
|
||||||
|
Text("\(store.alertEngine.activeAlerts.count)")
|
||||||
|
.font(.caption2.weight(.semibold))
|
||||||
|
.padding(.horizontal, 6)
|
||||||
|
.padding(.vertical, 2)
|
||||||
|
.background(Color.red.opacity(0.85), in: Capsule())
|
||||||
|
.foregroundStyle(.white)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} icon: {
|
||||||
|
Image(systemName: "bell.badge")
|
||||||
|
}
|
||||||
.tag("Alerts")
|
.tag("Alerts")
|
||||||
.badge(store.alertEngine.activeAlerts.isEmpty ? nil : Text("\(store.alertEngine.activeAlerts.count)"))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.listStyle(.sidebar)
|
.listStyle(.sidebar)
|
||||||
|
|||||||
Reference in New Issue
Block a user